lib/rex/post/meterpreter/client.rb in librex-0.0.43 vs lib/rex/post/meterpreter/client.rb in librex-0.0.44

- old
+ new

@@ -113,10 +113,12 @@ self.comm_timeout = opts[:comm_timeout] self.passive_dispatcher = opts[:passive_dispatcher] self.response_timeout = opts[:timeout] || self.class.default_timeout self.send_keepalives = true + # self.encode_unicode = opts.has_key?(:encode_unicode) ? opts[:encode_unicode] : true + self.encode_unicode = false if opts[:passive_dispatcher] initialize_passive_dispatcher register_extension_alias('core', ClientCore.new(self)) @@ -366,10 +368,24 @@ return items.sort end # + # Encodes (or not) a UTF-8 string + # + def unicode_filter_encode(str) + self.encode_unicode ? Rex::Text.unicode_filter_encode(str) : str + end + + # + # Decodes (or not) a UTF-8 string + # + def unicode_filter_decode(str) + self.encode_unicode ? Rex::Text.unicode_filter_decode(str) : str + end + + # # The extension alias under which all extensions can be accessed by name. # For example: # # client.ext.stdapi # @@ -422,9 +438,13 @@ attr_accessor :comm_timeout # # The Passive Dispatcher # attr_accessor :passive_dispatcher + # + # Flag indicating whether to hex-encode UTF-8 file names and other strings + # + attr_accessor :encode_unicode protected attr_accessor :parser, :ext_aliases # :nodoc: attr_writer :ext, :sock # :nodoc: end