Skip to content

Commit 96207ad

Browse files
committed
No spaces
1 parent dc98d34 commit 96207ad

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

modules/post/windows/gather/powershell/enum_services.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ def run
2727
print_good("Running the post module: #{name} on: " + session.shell_command('$env:COMPUTERNAME').gsub!(/(\r\n)/, ''))
2828
# Get all the services that are not in "C:\Windows\System32\"
2929
pscommand = '$services = Get-WmiObject win32_service | ?{$_} | where {($_.pathname -ne $null) -and ($_.pathname -notmatch ".*system32.*")} ; $servicepaths = New-Object System.Collections.ArrayList'
30-
print(session.shell_command(pscommand))
31-
30+
session.shell_command(pscommand)
3231
pscommand = 'foreach ($service in $services) { if ($service.PathName -Match "^(.+?)\.exe") {$servicepaths.Add($Matches[0].Replace(\'"\',\'\')) > $null} }'
33-
print(session.shell_command(pscommand))
34-
32+
session.shell_command(pscommand)
3533
pscommand = 'foreach ($service in $servicepaths) { "`n"+$service; get-acl $service | select-object -expandproperty AccessToString }'
3634
print(session.shell_command(pscommand))
3735
end

0 commit comments

Comments
 (0)