mirror of
https://github.com/PowerShellMafia/PowerSploit
synced 2026-06-08 12:13:33 +00:00
fixing EOL spaces
This commit is contained in:
+13
-24
@@ -19,7 +19,6 @@ Does a simple port scan using regular sockets, based (pretty) loosely on nmap
|
||||
|
||||
version .13
|
||||
|
||||
|
||||
.PARAMETER Hosts
|
||||
|
||||
Include these comma seperated hosts (supports IPv4 CIDR notation) or pipe them in
|
||||
@@ -89,7 +88,6 @@ How often (in terms of hosts) to sync threads and flush output
|
||||
2 {$nHosts=15; $Threads = 32; $Timeout = 3000 }
|
||||
1 {$nHosts=10; $Threads = 32; $Timeout = 5000 }
|
||||
|
||||
|
||||
.PARAMETER GrepOut
|
||||
|
||||
Greppable output file
|
||||
@@ -104,7 +102,7 @@ output file in 'readable' format
|
||||
|
||||
.PARAMETER AllformatsOut
|
||||
|
||||
output in readable (.nmap), xml (.xml), and greppable (.gnmap) formats
|
||||
output in readable (.nmap), xml (.xml), and greppable (.gnmap) formats
|
||||
|
||||
.PARAMETER noProgressMeter
|
||||
|
||||
@@ -118,7 +116,6 @@ supresses returned output and don't store hosts in memory - useful for very larg
|
||||
|
||||
Force Overwrite if output Files exist. Otherwise it throws exception
|
||||
|
||||
|
||||
.EXAMPLE
|
||||
|
||||
C:\PS> Invoke-Portscan -Hosts "webstersprodigy.net,google.com,microsoft.com" -TopPorts 50
|
||||
@@ -127,7 +124,6 @@ Description
|
||||
-----------
|
||||
Scans the top 50 ports for hosts found for webstersprodigy.net,google.com, and microsoft.com
|
||||
|
||||
|
||||
.EXAMPLE
|
||||
|
||||
C:\PS> echo webstersprodigy.net | Invoke-Portscan -oG test.gnmap -f -ports "80,443,8080"
|
||||
@@ -136,7 +132,6 @@ Description
|
||||
-----------
|
||||
Does a portscan of "webstersprodigy.net", and writes a greppable output file
|
||||
|
||||
|
||||
.EXAMPLE
|
||||
|
||||
C:\PS> Invoke-Portscan -Hosts 192.168.1.1/24 -T 4 -TopPorts 25 -oA localnet
|
||||
@@ -145,7 +140,6 @@ Description
|
||||
-----------
|
||||
Scans the top 20 ports for hosts found in the 192.168.1.1/24 range, outputs all file formats
|
||||
|
||||
|
||||
.LINK
|
||||
|
||||
http://webstersprodigy.net
|
||||
@@ -153,10 +147,12 @@ http://webstersprodigy.net
|
||||
|
||||
[CmdletBinding()]Param (
|
||||
#Host, Ports
|
||||
[Parameter(ParameterSetName="cmdHosts",
|
||||
[Parameter(ParameterSetName="cmdHosts",
|
||||
|
||||
ValueFromPipeline=$True,
|
||||
Mandatory = $True)]
|
||||
[String[]] $Hosts,
|
||||
Mandatory = $True)]
|
||||
|
||||
[String[]] $Hosts,
|
||||
|
||||
[Parameter(ParameterSetName="fHosts",
|
||||
Mandatory = $True)]
|
||||
@@ -363,11 +359,11 @@ http://webstersprodigy.net
|
||||
{
|
||||
Param (
|
||||
[Parameter(Mandatory = $True)]
|
||||
[ValidateRange(1,1000)]
|
||||
[ValidateRange(1,1000)]
|
||||
|
||||
[int] $numPorts
|
||||
)
|
||||
|
||||
|
||||
#list of top 1000 ports from nmap from Jun 2013
|
||||
[int[]] $topPortList = @(80,23,443,21,3389,110,445,139,143,53,135,3306,8080,22
|
||||
1723,111,995,993,5900,1025,1720,548,113,81,6001,179,1026,2000,8443,
|
||||
@@ -646,7 +642,6 @@ http://webstersprodigy.net
|
||||
return $False
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -661,7 +656,6 @@ http://webstersprodigy.net
|
||||
|
||||
[Environment]::CurrentDirectory=(Get-Location -PSProvider FileSystem).ProviderPath
|
||||
|
||||
|
||||
if ($Hosts)
|
||||
{
|
||||
foreach($h in $Hosts)
|
||||
@@ -771,7 +765,6 @@ http://webstersprodigy.net
|
||||
$sPortList = [string]::join(",", $portList)
|
||||
$sHostPortList = [string]::join(",", $hostPortList)
|
||||
|
||||
|
||||
########
|
||||
#Port Scan Code - run on a per host basis
|
||||
########
|
||||
@@ -887,7 +880,6 @@ http://webstersprodigy.net
|
||||
`$sockets.Remove($p)
|
||||
"@
|
||||
|
||||
|
||||
$timeoutCallback = [scriptblock]::Create($timeoutCallback)
|
||||
|
||||
$timeouts[$p] = New-Object System.Timers.Timer
|
||||
@@ -895,7 +887,6 @@ http://webstersprodigy.net
|
||||
$timeouts[$p].Interval = $timeout
|
||||
$timeouts[$p].Enabled = $true
|
||||
|
||||
|
||||
$myscriptblock = [scriptblock]::Create($scriptBlockAsString)
|
||||
$x = $sockets[$p].beginConnect($h, $p,(New-ScriptBlockCallback($myscriptblock)) , $null)
|
||||
|
||||
@@ -954,7 +945,6 @@ http://webstersprodigy.net
|
||||
|
||||
[string[]]$Ports = @()
|
||||
|
||||
|
||||
foreach($Port in $Portlist)
|
||||
{
|
||||
Try
|
||||
@@ -989,7 +979,6 @@ http://webstersprodigy.net
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# the outer loop is to flush the loop.
|
||||
# Otherwise Get-Job | Wait-Job could clog, etc
|
||||
|
||||
@@ -1037,17 +1026,19 @@ http://webstersprodigy.net
|
||||
$upHosts ++
|
||||
}
|
||||
|
||||
if (!$quiet)
|
||||
if (!$quiet)
|
||||
|
||||
{
|
||||
$hostDate = Get-Date
|
||||
$hostObj = New-Object System.Object
|
||||
$hostObj | Add-Member -MemberType Noteproperty -Name Hostname -Value $jobName
|
||||
$hostObj | Add-Member -MemberType Noteproperty -Name Hostname -Value $jobName
|
||||
|
||||
$hostObj | Add-Member -MemberType Noteproperty -Name alive -Value $hostUp
|
||||
$hostObj | Add-Member -MemberType Noteproperty -Name openPorts -Value $openPorts
|
||||
$hostObj | Add-Member -MemberType Noteproperty -Name closedPorts -Value $closedPorts
|
||||
$hostObj | Add-Member -MemberType Noteproperty -Name filteredPorts -Value $filteredPorts
|
||||
$hostObj | Add-Member -MemberType NoteProperty -Name finishTime -Value $hostDate
|
||||
|
||||
|
||||
$scannedHostList += $hostobj
|
||||
}
|
||||
|
||||
@@ -1095,5 +1086,3 @@ http://webstersprodigy.net
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user