Add decryption.final for proper padding

bug/bundler_fix
root 2015-05-29 10:33:55 +05:00
parent 2756c7375e
commit 3ac5088a9a
1 changed files with 5 additions and 4 deletions

View File

@ -7,6 +7,7 @@ require 'msf/core'
require 'msf/core/auxiliary/report'
require 'openssl'
require 'digest/md5'
require 'base64'
class Metasploit3 < Msf::Post
@ -204,7 +205,7 @@ class Metasploit3 < Msf::Post
report_host(:host => db[:Server]);
end
db_table << [ db[:Alias], db[:Type], db[:Server], db[:Port], db[:Database], db[:Namespace], db[:Userid], db[:Password]]
db_table << [ db[:Alias], db[:Type], db[:Server], db[:Port], db[:Database], db[:Namespace], db[:Userid], db[:Password] ]
end
return db_table
end
@ -283,7 +284,7 @@ class Metasploit3 < Msf::Post
report_host(:host => $1.to_s)
end
end
db_table << [ db[:Alias] , db[:Type] , db[:Url], db[:Userid] ]
db_table << [ db[:Alias] , db[:Type] , db[:Url], db[:Userid], db[:Password] ]
end
return db_table
end
@ -301,10 +302,10 @@ class Metasploit3 < Msf::Post
enc_password = Rex::Text.decode_base64(enc_password)
dk, iv = get_derived_key
des = OpenSSL::Cipher.new('DES-CBC')
des.decrypt
des.key = dk
des.iv = iv
des.update(enc_password)
password = des.update(enc_password) + des.final
end
def get_derived_key