Class Rex::Exploitation::ObfuscateJS
In: lib/rex/exploitation/obfuscatejs.rb
Parent: Object

Obfuscates javascript in various ways

Methods

Public Class methods

Initialize an instance of the obfuscator

Obfuscates symbols found within a javascript string. The symbols argument should have the following format:

{

   'Variables'  => [ 'var1', ... ],
   'Methods'    => [ 'method1', ... ],
   'Classes'    => [ { 'Namespace' => 'n', 'Class' => 'y'}, ... ],
   'Namespaces' => [ 'n', ... ]

}

Make sure you order your methods, classes, and namespaces by most specific to least specific to prevent partial substitution. For instance, if you have two methods (joe and joeBob), you should place joeBob before joe because it is more specific and will be globally replaced before joe is replaced.

Public Instance methods

Obfuscates the javascript string passed to the constructor

Returns the dynamic symbol associated with the supplied symbol name

Returns the replaced javascript string

Protected Instance methods

Get rid of comments

Replace method, class, and namespace symbols found in the javascript string

[Validate]