Minor changes to posh egressassess

client_ports
Christopher Truncer 2015-07-07 20:25:32 -04:00
parent 93fbbe20af
commit 9e0d7ee869
1 changed files with 10 additions and 8 deletions

View File

@ -592,15 +592,15 @@ function Invoke-EgressAssess
{ {
if ($Datatype -eq "ssn") { if ($Datatype -eq "ssn") {
Generate-SSN Generate-SSN
$ICMPData = $AllSSN [string]$ICMPData = $AllSSN
} }
elseif ($Datatype -eq "cc") { elseif ($Datatype -eq "cc") {
Generate-CreditCards Generate-CreditCards
$ICMPData = $AllCC [string]$ICMPData = $AllCC
} }
elseif ($Datatype -eq "names") { elseif ($Datatype -eq "names") {
Generate-Names Generate-Names
$ICMPData = $AllNames [string]$ICMPData = $AllNames
} }
elseif ($Datatype -notcontains "ssn" -or "cc" -or "names") { elseif ($Datatype -notcontains "ssn" -or "cc" -or "names") {
@ -667,7 +667,7 @@ function Invoke-EgressAssess
Do { Do {
try { try {
Write-Verbose "[*] Sending data via ICMP." Write-Verbose "[*] Sending data via ICMP."
$TotalPackets = [int]($ICMPData.length/$bufferSize) [int]$TotalPackets = ($ICMPData.length/$bufferSize)
While ($ByteReader -le ($ICMPData.length - $bufferSize)) While ($ByteReader -le ($ICMPData.length - $bufferSize))
{ {
Write-Verbose "[*] Sending $PacketNumber of $TotalPackets packets" Write-Verbose "[*] Sending $PacketNumber of $TotalPackets packets"
@ -689,10 +689,12 @@ function Invoke-EgressAssess
Write-Verbose $ErrorMessage Write-Verbose $ErrorMessage
Break Break
} }
Write-Verbose "[*] Transfer complete!" Write-Verbose "[*] Transfer complete!"
$loops-- $ByteReader = 0
Write-Verbose "[*] $loops loops remaining.." $PacketNumber = 0
} While ($loops -gt 0) $loops--
Write-Verbose "[*] $loops loops remaining.."
} While ($Loops -gt 0)
} }
} }