Skip to content

Commit 8a51305

Browse files
committed
Fix comments
1 parent ebeb988 commit 8a51305

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

modules/post/windows/gather/enum_services.rb

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ def initialize(info={})
1616
'Name' => "Windows Gather Service Info Enumeration",
1717
'Description' => %q{
1818
This module will query the system for services and display name and configuration
19-
info for each returned service. It allows you to optionally search the credentials, path, or start
20-
type for a string and only return the results that match. These query operations
19+
info for each returned service. It allows you to optionally search the credentials, path,
20+
or start type for a string and only return the results that match. These query operations
2121
are cumulative and if no query strings are specified, it just returns all services.
2222
NOTE: If the script hangs, windows firewall is most likely on and you did not
2323
migrate to a safe process (explorer.exe for example).
@@ -68,11 +68,11 @@ def run
6868
service_list.each do |sname|
6969
srv_conf = {}
7070
isgood = true
71-
#make sure we got a service name
71+
# make sure we got a service name
7272
if sname
7373
begin
7474
srv_conf = service_info(sname)
75-
#filter service based on filters passed, the are cumulative
75+
# filter service based on filters passed, the are cumulative
7676
if qcred and ! srv_conf['Credentials'].downcase.include? qcred.downcase
7777
isgood = false
7878
end
@@ -83,19 +83,20 @@ def run
8383
if qtype and ! (srv_conf['Startup'] || '').downcase.include? qtype.downcase
8484
isgood = false
8585
end
86-
#count the occurance of specific credentials services are running as
86+
# count the occurance of specific credentials services are running as
8787
serviceCred = srv_conf['Credentials'].upcase
8888
unless serviceCred.empty?
8989
if credentialCount.has_key?(serviceCred)
9090
credentialCount[serviceCred] += 1
9191
else
9292
credentialCount[serviceCred] = 1
93-
#let the user know a new service account has been detected for possible lateral movement opportunities
93+
# let the user know a new service account has been detected for possible lateral
94+
# movement opportunities
9495
print_good("New service credential detected: #{sname} is running as '#{srv_conf['Credentials']}'")
9596
end
9697
end
9798

98-
#if we are still good return the info
99+
# if we are still good return the info
99100
if isgood
100101
msgString = "\tName: #{sname}"
101102
msgString << "\n\t\tStartup: #{srv_conf['Startup']}"
@@ -114,7 +115,7 @@ def run
114115
print_error("Problem enumerating services")
115116
end
116117
end
117-
#store loot on completion of collection
118+
# store loot on completion of collection
118119
p = store_loot("windows.services", "text/plain", session, lootString, "windows_services.txt", "Windows Services")
119120
print_good("Loot file stored in: #{p.to_s}")
120121
end

0 commit comments

Comments
 (0)