Module: Msf::Exploit::JSObfu
- Defined in:
- lib/msf/core/exploit/jsobfu.rb
Instance Method Summary collapse
- #initialize(info = {}) ⇒ Object
-
#js_obfuscate(js, opts = {}) ⇒ ::Rex::Exploitation::JSObfu
Returns an JSObfu object.
Instance Method Details
#initialize(info = {}) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/msf/core/exploit/jsobfu.rb', line 8 def initialize(info={}) super ([ OptInt.new('JsObfuscate', [false, "Number of times to obfuscate JavaScript", 0]), OptString.new('JsIdentifiers', [false, "Identifiers to preserve for JsObfu"]) ], Exploit::JSObfu) end |
#js_obfuscate(js, opts = {}) ⇒ ::Rex::Exploitation::JSObfu
Returns an JSObfu object. A wrapper of ::Rex::Exploitation::JSObfu.new(js).obfuscate
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/msf/core/exploit/jsobfu.rb', line 25 def js_obfuscate(js, opts={}) iterations = (opts[:iterations] || datastore['JsObfuscate']).to_i identifiers = opts[:preserved_identifiers].blank? ? (datastore['JsIdentifiers'] || '').split(',') : opts[:preserved_identifiers] obfu = ::Rex::Exploitation::JSObfu.new(js) obfu_opts = {} obfu_opts.merge!(iterations: iterations) obfu_opts.merge!(preserved_identifiers: identifiers) obfu.obfuscate(obfu_opts) obfu end |