Skip to content

Commit

Permalink
Update invoke-massadministration.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
Msfv3n0m authored Nov 3, 2023
1 parent 36bb46d commit 016b5a3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions invoke-massadministration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,15 @@ function RunCommand ($ServersList, $cmd) {
}
}
}

function Netstat()
{
$Netstat = (Netstat -ano | Select -skip 2) -Join "`n" -Split "(?= [TU][CD]P\s+(?:\d+\.|\[\w*:\w*:))" |
% {$_.trim() -Replace "`n",' ' -Replace '\s{2,20}',','} |
ConvertFrom-Csv
$Netstat | Add-Member -MemberType NoteProperty -Name Path -Value ""
$Netstat | %{$_.Path = $(ps -id $_.pid | Select -ExpandProperty path)}
$Netstat| ?{$_.Path -ne $null} | ft -Autosize -Wrap
}
function ChangeAdminPass () {
Write-Host "Setting a new administrator password" -ForegroundColor Yellow
$newPass Read-Host "Please set a new password for $(whoami):" -AsSecureString
Expand All @@ -48,4 +56,4 @@ function ChangeAdminPass () {
# Vars
$ServersList = Get-Content -Path "$(pwd)\servers.txt"
# Logic
RunCommand ($ServersList, $cmd)
RunCommand ($ServersList, $cmd)

0 comments on commit 016b5a3

Please sign in to comment.