<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: VBScript: Stop Dictionary FTP Attacks in IIS using VBScript</title>
	<link>http://blog.netnerds.net/2006/10/vbscript-stop-dictionary-ftp-attacks-in-iis-using-vbscript/</link>
	<description>ls /usr/lolcat</description>
	<pubDate>Wed, 20 Aug 2008 02:05:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: John Marston</title>
		<link>http://blog.netnerds.net/2006/10/vbscript-stop-dictionary-ftp-attacks-in-iis-using-vbscript/#comment-497</link>
		<dc:creator>John Marston</dc:creator>
		<pubDate>Mon, 17 Sep 2007 16:54:49 +0000</pubDate>
		<guid>http://blog.netnerds.net/2006/10/vbscript-stop-dictionary-ftp-attacks-in-iis-using-vbscript/#comment-497</guid>
		<description>What's the addroute.bat file on drive w: ?</description>
		<content:encoded><![CDATA[<p>What's the addroute.bat file on drive w: ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joost</title>
		<link>http://blog.netnerds.net/2006/10/vbscript-stop-dictionary-ftp-attacks-in-iis-using-vbscript/#comment-496</link>
		<dc:creator>Joost</dc:creator>
		<pubDate>Sat, 25 Aug 2007 22:29:19 +0000</pubDate>
		<guid>http://blog.netnerds.net/2006/10/vbscript-stop-dictionary-ftp-attacks-in-iis-using-vbscript/#comment-496</guid>
		<description>Thanks Tim, I took the script from your site and it works flawlessly :)</description>
		<content:encoded><![CDATA[<p>Thanks Tim, I took the script from your site and it works flawlessly <img src='http://blog.netnerds.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://blog.netnerds.net/2006/10/vbscript-stop-dictionary-ftp-attacks-in-iis-using-vbscript/#comment-495</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Mon, 28 May 2007 04:00:38 +0000</pubDate>
		<guid>http://blog.netnerds.net/2006/10/vbscript-stop-dictionary-ftp-attacks-in-iis-using-vbscript/#comment-495</guid>
		<description>I give up.  It seems your page won't accept the less than character that immediately follows the DateCreated in the last line above.  Visit my website (vizimetrics.com) for the code.</description>
		<content:encoded><![CDATA[<p>I give up.  It seems your page won't accept the less than character that immediately follows the DateCreated in the last line above.  Visit my website (vizimetrics.com) for the code.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://blog.netnerds.net/2006/10/vbscript-stop-dictionary-ftp-attacks-in-iis-using-vbscript/#comment-494</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Mon, 28 May 2007 03:58:54 +0000</pubDate>
		<guid>http://blog.netnerds.net/2006/10/vbscript-stop-dictionary-ftp-attacks-in-iis-using-vbscript/#comment-494</guid>
		<description>OK... let's try this once more using the quickcode tags....


' Push Event Viewer Alert
Set objWMIService = GetObject("winmgmts:{(security)}!root/cimv2")
Set eventSink = wscript.CreateObject("WbemScripting.SWbemSink", "EVSINK_")
strWQL = "Select * from __InstanceCreationEvent where TargetInstance isa  'Win32_NTLogEvent' and TargetInstance.SourceName = 'MSFTPSVC' and TargetInstance.EventCode = 100"
objWMIService.ExecNotificationQueryAsync eventSink,strWQL

'Keep it going forever
While (True)
Wscript.Sleep(1000)
Wend

Sub EVSINK_OnObjectReady(objObject, objAsyncContext)

	Set objDictionary = CreateObject("Scripting.Dictionary")
	Set objFSO = CreateObject("Scripting.FileSystemObject")
	Set objLog = CreateObject("MSWC.IISLog")
	Set WshShell = WScript.CreateObject("WScript.Shell")

	serverIP =  "65.23.156.121"
	xMax = 3   'Max number of invalid login attempts
              xLogFiles = 10  'Max number of log files to keep in the folder before deleting them

	Set objFolder = objFSO.GetFolder("C:\WINDOWS\system32\LogFiles\MSFTPSVC1\")
	Set objFiles = objFolder.Files
	For Each fileName In objFiles
		lastFile = fileName
		Set f = objFSO.GetFile(fileName)
		If f.DateCreated</description>
		<content:encoded><![CDATA[<p>OK... let's try this once more using the quickcode tags....</p>
<p>' Push Event Viewer Alert<br />
Set objWMIService = GetObject("winmgmts:{(security)}!root/cimv2")<br />
Set eventSink = wscript.CreateObject("WbemScripting.SWbemSink", "EVSINK_")<br />
strWQL = "Select * from __InstanceCreationEvent where TargetInstance isa  'Win32_NTLogEvent' and TargetInstance.SourceName = 'MSFTPSVC' and TargetInstance.EventCode = 100"<br />
objWMIService.ExecNotificationQueryAsync eventSink,strWQL</p>
<p>'Keep it going forever<br />
While (True)<br />
Wscript.Sleep(1000)<br />
Wend</p>
<p>Sub EVSINK_OnObjectReady(objObject, objAsyncContext)</p>
<p>	Set objDictionary = CreateObject("Scripting.Dictionary")<br />
	Set objFSO = CreateObject("Scripting.FileSystemObject")<br />
	Set objLog = CreateObject("MSWC.IISLog")<br />
	Set WshShell = WScript.CreateObject("WScript.Shell")</p>
<p>	serverIP =  "65.23.156.121"<br />
	xMax = 3   'Max number of invalid login attempts<br />
              xLogFiles = 10  'Max number of log files to keep in the folder before deleting them</p>
<p>	Set objFolder = objFSO.GetFolder("C:\WINDOWS\system32\LogFiles\MSFTPSVC1\")<br />
	Set objFiles = objFolder.Files<br />
	For Each fileName In objFiles<br />
		lastFile = fileName<br />
		Set f = objFSO.GetFile(fileName)<br />
		If f.DateCreated</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://blog.netnerds.net/2006/10/vbscript-stop-dictionary-ftp-attacks-in-iis-using-vbscript/#comment-493</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Sun, 27 May 2007 10:17:04 +0000</pubDate>
		<guid>http://blog.netnerds.net/2006/10/vbscript-stop-dictionary-ftp-attacks-in-iis-using-vbscript/#comment-493</guid>
		<description>Chrissy... what must I do to post my code????

Tim</description>
		<content:encoded><![CDATA[<p>Chrissy... what must I do to post my code????</p>
<p>Tim</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://blog.netnerds.net/2006/10/vbscript-stop-dictionary-ftp-attacks-in-iis-using-vbscript/#comment-492</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Sun, 27 May 2007 10:13:33 +0000</pubDate>
		<guid>http://blog.netnerds.net/2006/10/vbscript-stop-dictionary-ftp-attacks-in-iis-using-vbscript/#comment-492</guid>
		<description>Not sure why my post was cut short.  Here's the rest of it... with a little overlap.


	For Each fileName In objFiles
		lastFile = fileName
		Set f = objFSO.GetFile(fileName)
		If f.DateCreated</description>
		<content:encoded><![CDATA[<p>Not sure why my post was cut short.  Here's the rest of it... with a little overlap.</p>
<p>	For Each fileName In objFiles<br />
		lastFile = fileName<br />
		Set f = objFSO.GetFile(fileName)<br />
		If f.DateCreated</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://blog.netnerds.net/2006/10/vbscript-stop-dictionary-ftp-attacks-in-iis-using-vbscript/#comment-491</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Sun, 27 May 2007 10:11:32 +0000</pubDate>
		<guid>http://blog.netnerds.net/2006/10/vbscript-stop-dictionary-ftp-attacks-in-iis-using-vbscript/#comment-491</guid>
		<description>Ok... well

I've been playing with this script (and chrissy's orignal) for quite a while now.   After a LOT of experimenting, I decided I really don't need the IP's added to the ftp directory security table.... what's the point?   If the IP's are added as a bad route... that handles it all.

I've also re-thought the code a few times.

I've deleted the generic ftp file path finder... you can add it back in if you need it.  I just hard coded a path to the one ftp file on my server.  It's less flexible but MUCH simpler.

I added in the code to delete older log files.

I changed the ROUTE ADD statement to make it a persistent route.

Finally, I changed the way the dictionary objects were being used, to let them keep count of the login attempts in the log file.

Here's where I'm at.... it's working 100% for me....

' Push Event Viewer Alert
Set objWMIService = GetObject("winmgmts:{(security)}!root/cimv2")
Set eventSink = wscript.CreateObject("WbemScripting.SWbemSink", "EVSINK_")
strWQL = "Select * from __InstanceCreationEvent where TargetInstance isa  'Win32_NTLogEvent' and TargetInstance.SourceName = 'MSFTPSVC' and TargetInstance.EventCode = 100"
objWMIService.ExecNotificationQueryAsync eventSink,strWQL

'Keep it going forever
While (True)
Wscript.Sleep(1000)
Wend

Sub EVSINK_OnObjectReady(objObject, objAsyncContext)

	Set objDictionary = CreateObject("Scripting.Dictionary")
	Set objFSO = CreateObject("Scripting.FileSystemObject")
	Set objLog = CreateObject("MSWC.IISLog")
	Set WshShell = WScript.CreateObject("WScript.Shell")

	serverIP =  "65.23.156.121"
	xMax = 3   'Max number of invalid login attempts
              xLogFiles = 10  'Max number of log files to keep in the folder before deleting them

	Set objFolder = objFSO.GetFolder("C:\WINDOWS\system32\LogFiles\MSFTPSVC1\")
	Set objFiles = objFolder.Files
	For Each fileName In objFiles
		lastFile = fileName
		Set f = objFSO.GetFile(fileName)
		If f.DateCreated</description>
		<content:encoded><![CDATA[<p>Ok... well</p>
<p>I've been playing with this script (and chrissy's orignal) for quite a while now.   After a LOT of experimenting, I decided I really don't need the IP's added to the ftp directory security table.... what's the point?   If the IP's are added as a bad route... that handles it all.</p>
<p>I've also re-thought the code a few times.</p>
<p>I've deleted the generic ftp file path finder... you can add it back in if you need it.  I just hard coded a path to the one ftp file on my server.  It's less flexible but MUCH simpler.</p>
<p>I added in the code to delete older log files.</p>
<p>I changed the ROUTE ADD statement to make it a persistent route.</p>
<p>Finally, I changed the way the dictionary objects were being used, to let them keep count of the login attempts in the log file.</p>
<p>Here's where I'm at.... it's working 100% for me....</p>
<p>' Push Event Viewer Alert<br />
Set objWMIService = GetObject("winmgmts:{(security)}!root/cimv2")<br />
Set eventSink = wscript.CreateObject("WbemScripting.SWbemSink", "EVSINK_")<br />
strWQL = "Select * from __InstanceCreationEvent where TargetInstance isa  'Win32_NTLogEvent' and TargetInstance.SourceName = 'MSFTPSVC' and TargetInstance.EventCode = 100"<br />
objWMIService.ExecNotificationQueryAsync eventSink,strWQL</p>
<p>'Keep it going forever<br />
While (True)<br />
Wscript.Sleep(1000)<br />
Wend</p>
<p>Sub EVSINK_OnObjectReady(objObject, objAsyncContext)</p>
<p>	Set objDictionary = CreateObject("Scripting.Dictionary")<br />
	Set objFSO = CreateObject("Scripting.FileSystemObject")<br />
	Set objLog = CreateObject("MSWC.IISLog")<br />
	Set WshShell = WScript.CreateObject("WScript.Shell")</p>
<p>	serverIP =  "65.23.156.121"<br />
	xMax = 3   'Max number of invalid login attempts<br />
              xLogFiles = 10  'Max number of log files to keep in the folder before deleting them</p>
<p>	Set objFolder = objFSO.GetFolder("C:\WINDOWS\system32\LogFiles\MSFTPSVC1\")<br />
	Set objFiles = objFolder.Files<br />
	For Each fileName In objFiles<br />
		lastFile = fileName<br />
		Set f = objFSO.GetFile(fileName)<br />
		If f.DateCreated</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: InTech</title>
		<link>http://blog.netnerds.net/2006/10/vbscript-stop-dictionary-ftp-attacks-in-iis-using-vbscript/#comment-490</link>
		<dc:creator>InTech</dc:creator>
		<pubDate>Sat, 14 Apr 2007 06:11:57 +0000</pubDate>
		<guid>http://blog.netnerds.net/2006/10/vbscript-stop-dictionary-ftp-attacks-in-iis-using-vbscript/#comment-490</guid>
		<description>Has anyone gotten this to work? With no sink, am I just running this as a scheduled task to check connections?

I NEED THIS! MY FTP SERVER IS CONSTANTLY BEING ATTACKED!</description>
		<content:encoded><![CDATA[<p>Has anyone gotten this to work? With no sink, am I just running this as a scheduled task to check connections?</p>
<p>I NEED THIS! MY FTP SERVER IS CONSTANTLY BEING ATTACKED!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Spencer Ruport</title>
		<link>http://blog.netnerds.net/2006/10/vbscript-stop-dictionary-ftp-attacks-in-iis-using-vbscript/#comment-489</link>
		<dc:creator>Spencer Ruport</dc:creator>
		<pubDate>Thu, 12 Apr 2007 12:51:25 +0000</pubDate>
		<guid>http://blog.netnerds.net/2006/10/vbscript-stop-dictionary-ftp-attacks-in-iis-using-vbscript/#comment-489</guid>
		<description>For some reason I couldn't get the event code to work on my server. I'm sure this was a mistake on my part but since my FTP logs are relatively small I just have the script execute every 10 minutes.

Also the routes don't stick after a reboot. Most of these attacks are coming from dynamic IPs so I only want the blocks in place long enough for the attackers to give up.

There's no copyright to the modifications I made.</description>
		<content:encoded><![CDATA[<p>For some reason I couldn't get the event code to work on my server. I'm sure this was a mistake on my part but since my FTP logs are relatively small I just have the script execute every 10 minutes.</p>
<p>Also the routes don't stick after a reboot. Most of these attacks are coming from dynamic IPs so I only want the blocks in place long enough for the attackers to give up.</p>
<p>There's no copyright to the modifications I made.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: M Mucklo</title>
		<link>http://blog.netnerds.net/2006/10/vbscript-stop-dictionary-ftp-attacks-in-iis-using-vbscript/#comment-488</link>
		<dc:creator>M Mucklo</dc:creator>
		<pubDate>Sat, 24 Feb 2007 20:09:07 +0000</pubDate>
		<guid>http://blog.netnerds.net/2006/10/vbscript-stop-dictionary-ftp-attacks-in-iis-using-vbscript/#comment-488</guid>
		<description>Also do these routes stick after server reboot?</description>
		<content:encoded><![CDATA[<p>Also do these routes stick after server reboot?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
