<?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>youdidwhatwithtsql.com &#187; Uncategorized</title>
	<atom:link href="http://www.youdidwhatwithtsql.com/category/uncategorized/feed" rel="self" type="application/rss+xml" />
	<link>http://www.youdidwhatwithtsql.com</link>
	<description>making DBAs everywhere curse!</description>
	<lastBuildDate>Tue, 31 Jan 2012 12:21:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Check database auto-shrink setting with Powershell</title>
		<link>http://www.youdidwhatwithtsql.com/check-database-autoshrink-setting-powershell/1089</link>
		<comments>http://www.youdidwhatwithtsql.com/check-database-autoshrink-setting-powershell/1089#comments</comments>
		<pubDate>Thu, 12 May 2011 09:00:40 +0000</pubDate>
		<dc:creator>Rhys</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.youdidwhatwithtsql.com/?p=1089</guid>
		<description><![CDATA[It&#8217;s very well known that auto-shrink is bad for reasons I won&#8217;t repeat here. Perhaps you&#8217;ve been meaning to check all your servers and databases but simply haven&#8217;t got around to it? A simple bit of Powershell makes this into a trivial task; ?View Code POWERSHELL# Load SMO &#91;System.Reflection.Assembly&#93;::LoadWithPartialName&#40;&#34;Microsoft.SqlServer.Smo&#34;&#41; &#124; Out-Null; &#160; # List of [...]<p>Post from: <a href="http://www.youdidwhatwithtsql.com">youdidwhatwithtsql.com</a><br/><br/><a href="http://www.youdidwhatwithtsql.com/check-database-autoshrink-setting-powershell/1089">Check database auto-shrink setting with Powershell</a></p>
]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s very well known that <a title="Turn AUTO_SHRINK off!!" href="http://blogs.msdn.com/b/sqlserverstorageengine/archive/2007/03/28/turn-auto-shrink-off.aspx" target="_blank">auto-shrink is bad</a> for reasons I won&#8217;t repeat here. Perhaps you&#8217;ve been meaning to check all your servers and databases but simply haven&#8217;t got around to it? A simple bit of <a title="Windows Powershell" href="http://en.wikipedia.org/wiki/Windows_PowerShell" target="_blank">Powershell</a> makes this into a trivial task;</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p1089code2'); return false;">View Code</a> POWERSHELL</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p10892"><td class="code" id="p1089code2"><pre class="powershell" style="font-family:monospace;"><span style="color: #008000;"># Load SMO</span>
<span style="color: #000000;">&#91;</span><span style="color: #008080;">System.Reflection.Assembly</span><span style="color: #000000;">&#93;</span>::<span style="color: #800000;">LoadWithPartialName</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Microsoft.SqlServer.Smo&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Out-Null</span>;
&nbsp;
<span style="color: #008000;"># List of sql servers here</span>
<span style="color: #800080;">$sqlservers</span> <span style="color: pink;">=</span> <span style="color: pink;">@</span><span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;server1&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;server2&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;server3&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;server4&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;server5&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;server6&quot;</span><span style="color: #000000;">&#41;</span>;
&nbsp;
<span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$sqlserver</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$sqlservers</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #800080;">$srv</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> Microsoft.SqlServer.Management.Smo.Server <span style="color: #800080;">$sqlserver</span>;
	<span style="color: #800080;">$databases</span> <span style="color: pink;">=</span> <span style="color: #800080;">$srv</span>.Databases;
	<span style="color: #800080;">$count</span> <span style="color: pink;">=</span> <span style="color: #804000;">0</span>;
	<span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$db</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$databases</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>	
		<span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$db</span>.AutoShrink <span style="color: #FF0000;">-eq</span> <span style="color: #800080;">$true</span><span style="color: #000000;">&#41;</span>
		<span style="color: #000000;">&#123;</span>
			<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #008080; font-style: italic;">-ForegroundColor</span> Red <span style="color: #800000;">&quot;Warning: $db on $sqlserver has auto-shrink enabled.&quot;</span>;
			<span style="color: #800080;">$count</span><span style="color: pink;">++</span>;
		<span style="color: #000000;">&#125;</span>
	<span style="color: #000000;">&#125;</span>
	<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;$sqlserver has $count databases set to auto-shrink.&quot;</span>;
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>The script will output something like below;</p>
<pre>Warning: [db1] on server1 has auto-shrink enabled.
server1 has 1 databases set to auto-shrink.
server2 has 0 databases set to auto-shrink.
server3 has 0 databases set to auto-shrink.
server4 has 0 databases set to auto-shrink.
server5 has 0 databases set to auto-shrink.
server6 has 0 databases set to auto-shrink.
</pre>
<p><map name='google_ad_map_1089_a45beff5d2e172f6'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/1089?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_1089_a45beff5d2e172f6' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=1089&amp;url=http%3A%2F%2Fwww.youdidwhatwithtsql.com%2Fcheck-database-autoshrink-setting-powershell%2F1089' title="Check database auto shrink setting with Powershell" alt=" Check database auto shrink setting with Powershell" /></p><p>Post from: <a href="http://www.youdidwhatwithtsql.com">youdidwhatwithtsql.com</a><br/><br/><a href="http://www.youdidwhatwithtsql.com/check-database-autoshrink-setting-powershell/1089">Check database auto-shrink setting with Powershell</a></p>
<div class="none"><div class="g-plusone" data-href="http://www.youdidwhatwithtsql.com/check-database-autoshrink-setting-powershell/1089" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.youdidwhatwithtsql.com/check-database-autoshrink-setting-powershell/1089/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hack Attack</title>
		<link>http://www.youdidwhatwithtsql.com/hack-attack/48</link>
		<comments>http://www.youdidwhatwithtsql.com/hack-attack/48#comments</comments>
		<pubDate>Tue, 24 Mar 2009 20:08:44 +0000</pubDate>
		<dc:creator>Rhys</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.youdidwhatwithtsql.com/hack-attack/48</guid>
		<description><![CDATA[Today I spotted a suspicious looking file called login.txt on the c drive of a customers web server. Being the nosey curious type I opened the file and this is what it contained&#8230; Welcome!!! This server is hacked by This_is_Joepie. Download with fun and: DON'T PUBLISH THIS IP ANYWHERE DON'T REHACK THIS SERVER DON'T SCAN [...]<p>Post from: <a href="http://www.youdidwhatwithtsql.com">youdidwhatwithtsql.com</a><br/><br/><a href="http://www.youdidwhatwithtsql.com/hack-attack/48">Hack Attack</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Today I spotted a suspicious looking file called <strong>login.txt </strong>on the c drive of a customers web server. Being the <strike>nosey</strike> curious type I opened the file and this is what it contained&#8230;</p>
<pre>Welcome!!!

This server is hacked by This_is_Joepie.
Download with fun and:
DON'T PUBLISH THIS IP ANYWHERE
DON'T REHACK THIS SERVER
DON'T SCAN THIS IP RANGE

Thnx!!!

==========================================
Bandwidth Usage: %ServerKBps KB/sec
Users Connected: %UNow
==========================================
Server Uptime: %ServerDays Days, %ServerHours Hours
==========================================”</pre>
<p>I googled <a href="http://www.google.com/search?q=This_is_Joepie&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t" target="_blank">This_is_Joepie</a> and, assuming they&#8217;re the same person, this seems to be a gaming enthusiast from Holland. I went back to the c drive and ordered the files by last modified date revealing several more interesting files. The most interesting was <strong>Servudaemon.ini</strong> </p>
<pre>[GLOBAL]
Version=3.0.0.17
RegistrationKey=6dYwuCzKYyiSYQm0Hlp0OmDivgW8pyxAM2ZMLSpgg9Ywu+psehNIYwi0Ex4bTweO33ac5V4vRxJZXk8MhblFzGyrF1z1DWbWfzZaVAWW
LocalSetupPassword=45244E5D5D024857420D585F
LocalSetupPortNo=5555
AntiHammer=1
SocketKeepAlive=1
PacketTimeOut=300
BlockAntiTimeOut=1
SocketInlineOOB=1
AntiHammerBlock=1200
AntiHammerWindow=60
SocketRcvBuffer=37376
SocketSndBuffer=37376
BlockFTPBounceAttack=1
OpenFilesUploadMode=Shared
ProcessID=1888

[DOMAINS]
Domain1=0.0.0.0||65101|FTP|1

[Domain1]
ReplyTooMany=Too many leechers....try again later m8!
SignOn=c:\login.txt
DirChangeMesFile=cdir.txt
ReplyHello=Welcome to this hacked server by Razorblade
ReplySYST=Guess
LogFileSystemMes=0
LogFileSecurityMes=0
LogFileGETs=0
LogFilePUTs=0
MaxNrUsers=15
ReplyHelp=You don't need help, right?!
ReplyNoAnon=NO ANONYMOUS ACCES!! LEAVE!!!
ReplyOffline=Server is down....
User1=master|1|0
User2=leechers|1|0
DirChangeMesFile2=cdir.txt

[USER=master|1]
Password=ts20A63ADD1C5CC3D10C6BCF25C6C7D3C8
HomeDir=c:\
AlwaysAllowLogin=1
ChangePassword=1
TimeOut=600
Maintenance=System
Access1=c:\|RWAMELCDP
Access2=f:\|RWAMELCDP
Access3=d:\|RWAMELCDP
Access4=e:\|RWAMELCDP
Access5=h:\|RWAMELCDP
Access6=g:\|RWAMELCDP
Access7=m:\|RWAMELCDP
Access8=i:\|RWAMELCDP
Access9=h:\|RWAMELCDP

[USER=leechers|1]
Password=gn27FD3D071B1D3F0D55F158DDA003B76C
HomeDir=f:\server
RelPaths=1
HideHidden=1
MaxUsersLoginPerIP=1
TimeOut=600
Access1=f:\server|RLP</pre>
<p>Now I guess this person was running some kind of Warez ftp server. I couldn&#8217;t locate any services running on the ports mentioned above or any dodgy looking files on the server. Do hackers clean up after themselves? The worrying thing is the the last modified date on these files was back at the start of 2002! </p>
<p><map name='google_ad_map_48_a45beff5d2e172f6'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/48?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_48_a45beff5d2e172f6' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=48&amp;url=http%3A%2F%2Fwww.youdidwhatwithtsql.com%2Fhack-attack%2F48' title="Hack Attack" alt=" Hack Attack" /></p><p>Post from: <a href="http://www.youdidwhatwithtsql.com">youdidwhatwithtsql.com</a><br/><br/><a href="http://www.youdidwhatwithtsql.com/hack-attack/48">Hack Attack</a></p>
<div class="none"><div class="g-plusone" data-href="http://www.youdidwhatwithtsql.com/hack-attack/48" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.youdidwhatwithtsql.com/hack-attack/48/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello world!</title>
		<link>http://www.youdidwhatwithtsql.com/hello-world/1</link>
		<comments>http://www.youdidwhatwithtsql.com/hello-world/1#comments</comments>
		<pubDate>Sat, 24 Jan 2009 17:35:11 +0000</pubDate>
		<dc:creator>Rhys</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.youdidwhatwithtsql.com/?p=1</guid>
		<description><![CDATA[Welcome to WordPress. This is your first post. Edit or delete it, then start blogging! Post from: youdidwhatwithtsql.comHello world!<p>Post from: <a href="http://www.youdidwhatwithtsql.com">youdidwhatwithtsql.com</a><br/><br/><a href="http://www.youdidwhatwithtsql.com/hello-world/1">Hello world!</a></p>
]]></description>
			<content:encoded><![CDATA[<p>Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!</p>
<p><map name='google_ad_map_1_a45beff5d2e172f6'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/1?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_1_a45beff5d2e172f6' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=1&amp;url=http%3A%2F%2Fwww.youdidwhatwithtsql.com%2Fhello-world%2F1' title="Hello world!" alt=" Hello world!" /></p><p>Post from: <a href="http://www.youdidwhatwithtsql.com">youdidwhatwithtsql.com</a><br/><br/><a href="http://www.youdidwhatwithtsql.com/hello-world/1">Hello world!</a></p>
<div class="none"><div class="g-plusone" data-href="http://www.youdidwhatwithtsql.com/hello-world/1" size="standard" count="true"></div></div>]]></content:encoded>
			<wfw:commentRss>http://www.youdidwhatwithtsql.com/hello-world/1/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

