Class: Rex::Exploitation::Js::Utils

Inherits:
Object
  • Object
show all
Defined in:
lib/rex/exploitation/js/utils.rb

Overview

Javascript utilities

Class Method Summary collapse

Class Method Details

.base64Object


16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/rex/exploitation/js/utils.rb', line 16

def self.base64
  js = ::File.read(::File.join(Msf::Config.data_directory, "js", "utils", "base64.js"))

  opts = {
    'Symbols' => {
      'Variables' => %w{ Base64 encoding result _keyStr encoded_data utftext input_idx
        input output chr chr1 chr2 chr3 enc1 enc2 enc3 enc4 },
      'Methods'   => %w{ _utf8_encode _utf8_decode encode decode }
    }
  }

  ::Rex::Exploitation::ObfuscateJS.new(js, opts).to_s
end