@@ -41,7 +41,6 @@ def initialize(info={})
41
41
def run
42
42
43
43
# set vars
44
- lootString = ""
45
44
credentialCount = { }
46
45
qcred = datastore [ "CRED" ] || nil
47
46
qpath = datastore [ "PATH" ] || nil
@@ -73,13 +72,7 @@ def run
73
72
'Columns' => [ 'Name' , 'Credentials' , 'Command' , 'Startup' ]
74
73
)
75
74
76
- if datastore [ 'VERBOSE' ]
77
- print_status ( "Listing Service Info for matching services:" )
78
- else
79
- print_status ( "Detailed output is only printed when VERBOSE is set to True. Running this module can take some time.\n " )
80
- end
81
-
82
- print_status ( "Listing Service Info for matching services:" )
75
+ print_status ( "Listing Service Info for matching services, please wait..." )
83
76
service_list . each do |srv |
84
77
srv_conf = { }
85
78
@@ -103,15 +96,15 @@ def run
103
96
end
104
97
105
98
# count the occurance of specific credentials services are running as
106
- serviceCred = srv_conf [ 'Credentials' ] . upcase
99
+ serviceCred = srv_conf [ :startname ] . upcase
107
100
unless serviceCred . empty?
108
101
if credentialCount . has_key? ( serviceCred )
109
102
credentialCount [ serviceCred ] += 1
110
103
else
111
104
credentialCount [ serviceCred ] = 1
112
105
# let the user know a new service account has been detected for possible lateral
113
106
# movement opportunities
114
- print_good ( "New service credential detected: #{ sname } is running as '#{ srv_conf [ 'Credentials' ] } '" )
107
+ print_good ( "New service credential detected: #{ srv [ :name ] } is running as '#{ srv_conf [ :startname ] } '" )
115
108
end
116
109
end
117
110
@@ -125,7 +118,7 @@ def run
125
118
print_error ( "An error occurred enumerating service: #{ srv [ :name ] } : #{ e } " )
126
119
end
127
120
else
128
- print_error ( "Problem enumerating services ( no service name found) " )
121
+ print_error ( "Problem enumerating service - no service name found" )
129
122
end
130
123
end
131
124
0 commit comments